オブジェクトのリストで多くの処理と検索を行っています。結果のレンダリング中にアプリケーションがメモリ不足になります。オブジェクトのリストを効率的に処理/処理するための API はありますか?それを最適化しようとしています。
もう 1 つ伝えたいことは、すべてのリストを新しい ArrayList で初期化しています。他のものを使用する必要がありますか?
レコードを表示し、これらのレコードを検索する必要がある画面があり、そこで API を使用しています (DB にアクセスできず、SQL クエリを実行できないため、唯一の方法です)。画面に表示される各レコード特定の基準で検索され、同じ検索 API を使用しています。コードをデバッグしていて、その検索方法によって例外がスローされることがわかりました。エラーログを貼り付けています
Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.0.2.v20100323-r6872): org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: java.sql.SQLException: [OWLS][SQLServer JDBC Driver][SQLServer]There is insufficient system memory in resource pool 'internal' to run this query.
Error Code: 701
Call: SELECT DISTINCT t0.PRIMARY_KEY, t0.TOTAL_ACCRUAL, t0.TOTAL_ALLOCATED, t0.ALLOC_LIMIT, t0.APPL_END_ON, t0.APPL_EXPENSE_PERCENT, t0.APPL_NON_US_TAX_PERCENT, t0.APPL_INVD_EXPENSE_PERCENT, t0.APPL_INVD_TASK_PERCENT, t0.APPL_START_ON, t0.APPL_TASK_PERCENT, t0.INVOLVED_APPL_TYPE_IID, t0.PROJECT_APPL_TYPE_IID, t0.VENDOR_APPL_TYPE_IID, t0.TOTAL_BG_AVAILABLE, t0.CREATED_ON, t0.STATUS_IID, t0.APPL_EXPENSE, t0.APPL_INVC_ACCRUAL, t0.APPL_INVC_CREDIT_NOTE, t0.APPL_NON_US_TAX, t0.APPL_INVC_SHADOW, t0.APPL_INVC_STANDARD, t0.APPL_INVD_EXPENSE, t0.APPL_INVD_TASK, t0.APPL_TASK, t0.AUTO_POST, t0.MODIFIED_ON, t0.NAME, t0.OVERDRAFT_TYPE_IID, t0.POSTED_TYPE_IID, t0.SECURITY_TYPE_IID, t0.TREE_KEY, t0.TYPE_IID, t0.TOTAL_USED, t0.VERSION, t0.APPL_EXPENSE_CATEGORY_ID, t0.APPL_NON_US_TAX_TYPE, t0.APPL_INVOLVED_ID, t0.APPL_INVD_EXP_CATEGORY_ID, t0.APPL_INVD_TASK_CATEGORY_ID, t0.APPL_PROJECT_CATEGORY_ID, t0.APPL_PROJ_DETAIL_FIELD_ID, t0.PROJECT_ID, t0.APPL_TASK_CATEGORY_ID, t0.APPL_VENDOR_ID, t0.APPROVAL_STATUS_ID, t0.CREATED_BY_ID, t0.CREATED_ON_BEHALF_OF_ID, t0.DEFAULT_CATEGORY_ID, t0.DOCUMENT_FOLDER_ID, t0.FORUM_ID, t0.MODIFIED_BY_ID, t0.NOTE_ID, t0.PARENT_ACCOUNT_ID FROM T_ACCOUNT_SECURITY_FILTER t5, Y_OBJ_CATEGORY t4, T_PROJECT t3, E_ACCT t2, T_CONTACT t1, T_ACCOUNT t0 WHERE ((((((((((t0.VENDOR_APPL_TYPE_IID = 2) AND (t1.PRIMARY_KEY = 2004)) AND (t2."YEARACCT" = N'2012')) AND (t0.PROJECT_APPL_TYPE_IID = 2)) AND (t3.PRIMARY_KEY = 46537)) AND (t4.TREE_POSITION = N'ACCT_ACTL_CCSP_VNDR_MONT')) AND (t0.NAME = N'Actuals - Cost Center 10 - LA2012000250 - Singla, Ashima - 2012 - October')) AND (t2."PERIODACCT" = N'M9')) AND (t5.USER_ID = 1504)) AND (((((t1.PRIMARY_KEY = t0.APPL_VENDOR_ID) AND (t2.ACCOUNT_ID$ = t0.PRIMARY_KEY)) AND (t3.PRIMARY_KEY = t0.PROJECT_ID)) AND (t4.PRIMARY_KEY = t0.DEFAULT_CATEGORY_ID)) AND (t5.ENTERPRISE_OBJECT_ID = t0.PRIMARY_KEY)))
Query: ReadAllQuery(referenceClass=TFAccount sql="SELECT DISTINCT t0.PRIMARY_KEY, t0.TOTAL_ACCRUAL, t0.TOTAL_ALLOCATED, t0.ALLOC_LIMIT, t0.APPL_END_ON, t0.APPL_EXPENSE_PERCENT, t0.APPL_NON_US_TAX_PERCENT, t0.APPL_INVD_EXPENSE_PERCENT, t0.APPL_INVD_TASK_PERCENT, t0.APPL_START_ON, t0.APPL_TASK_PERCENT, t0.INVOLVED_APPL_TYPE_IID, t0.PROJECT_APPL_TYPE_IID, t0.VENDOR_APPL_TYPE_IID, t0.TOTAL_BG_AVAILABLE, t0.CREATED_ON, t0.STATUS_IID, t0.APPL_EXPENSE, t0.APPL_INVC_ACCRUAL, t0.APPL_INVC_CREDIT_NOTE, t0.APPL_NON_US_TAX, t0.APPL_INVC_SHADOW, t0.APPL_INVC_STANDARD, t0.APPL_INVD_EXPENSE, t0.APPL_INVD_TASK, t0.APPL_TASK, t0.AUTO_POST, t0.MODIFIED_ON, t0.NAME, t0.OVERDRAFT_TYPE_IID, t0.POSTED_TYPE_IID, t0.SECURITY_TYPE_IID, t0.TREE_KEY, t0.TYPE_IID, t0.TOTAL_USED, t0.VERSION, t0.APPL_EXPENSE_CATEGORY_ID, t0.APPL_NON_US_TAX_TYPE, t0.APPL_INVOLVED_ID, t0.APPL_INVD_EXP_CATEGORY_ID, t0.APPL_INVD_TASK_CATEGORY_ID, t0.APPL_PROJECT_CATEGORY_ID, t0.APPL_PROJ_DETAIL_FIELD_ID, t0.PROJECT_ID, t0.APPL_TASK_CATEGORY_ID, t0.APPL_VENDOR_ID, t0.APPROVAL_STATUS_ID, t0.CREATED_BY_ID, t0.CREATED_ON_BEHALF_OF_ID, t0.DEFAULT_CATEGORY_ID, t0.DOCUMENT_FOLDER_ID, t0.FORUM_ID, t0.MODIFIED_BY_ID, t0.NOTE_ID, t0.PARENT_ACCOUNT_ID FROM T_ACCOUNT_SECURITY_FILTER t5, Y_OBJ_CATEGORY t4, T_PROJECT t3, E_ACCT t2, T_CONTACT t1, T_ACCOUNT t0 WHERE ((((((((((t0.VENDOR_APPL_TYPE_IID = ?) AND (t1.PRIMARY_KEY = ?)) AND (t2."YEARACCT" = ?)) AND (t0.PROJECT_APPL_TYPE_IID = ?)) AND (t3.PRIMARY_KEY = ?)) AND (t4.TREE_POSITION = ?)) AND (t0.NAME = ?)) AND (t2."PERIODACCT" = ?)) AND (t5.USER_ID = ?)) AND (((((t1.PRIMARY_KEY = t0.APPL_VENDOR_ID) AND (t2.ACCOUNT_ID$ = t0.PRIMARY_KEY)) AND (t3.PRIMARY_KEY = t0.PROJECT_ID)) AND (t4.PRIMARY_KEY = t0.DEFAULT_CATEGORY_ID)) AND (t5.ENTERPRISE_OBJECT_ID = t0.PRIMARY_KEY)))")
at org.eclipse.persistence.exceptions.DatabaseException.sqlException(DatabaseException.java:333)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:687)
at org.eclipse.persistence.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:530)
at org.eclipse.persistence.sessions.server.ServerSession.executeCall(ServerSession.java:529)
ありがとうラヴィ・クマール