另类的java.lang.OutOfMemoryError
2017-12-13 15:40
267 查看
一看到内存溢出,我第一想到的是分析dump文件,昨天的事情就颠覆了我的认知,分析dump没有发现问题。仔细看堆栈,然后看代码:
List<ATTransVO> lstATTransVO = new ArrayList<ATTransVO>(10000000);
这个初始化的数值太大导致内存不够用,难怪分析不出问题来。
2017-12-12 17:24:52,227
StackTrace : com.gg.lcam.component.workflow.entrycondition.ReceiptCheckEntryCondition$HasAttachmentOperation.canEntry(ReceiptCheckEntryCondition.java:341)
javax.ejb.EJBTransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space; nested exception is: javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledback(EJBRuntimeUtils.java:200)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:887)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:809)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:518)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl_CBV.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
..................................................................................
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
javax.ejb.EJBTransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space; nested exception is: javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:818)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:518)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl_CBV.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
..................................................................................
Caused by: javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledback(EJBRuntimeUtils.java:200)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:887)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:809)
... 104 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
List<ATTransVO> lstATTransVO = new ArrayList<ATTransVO>(10000000);
这个初始化的数值太大导致内存不够用,难怪分析不出问题来。
2017-12-12 17:24:52,227
StackTrace : com.gg.lcam.component.workflow.entrycondition.ReceiptCheckEntryCondition$HasAttachmentOperation.canEntry(ReceiptCheckEntryCondition.java:341)
javax.ejb.EJBTransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space; nested exception is: javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledback(EJBRuntimeUtils.java:200)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:887)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:809)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:518)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl_CBV.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
..................................................................................
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
javax.ejb.EJBTransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space; nested exception is: javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:818)
at weblogic.ejb.container.internal.BaseRemoteObject.postInvoke1(BaseRemoteObject.java:518)
at weblogic.ejb.container.internal.StatelessRemoteObject.postInvoke1(StatelessRemoteObject.java:49)
at weblogic.ejb.container.internal.BaseRemoteObject.__WL_postInvokeTxRetry(BaseRemoteObject.java:444)
at weblogic.ejb.container.internal.SessionRemoteMethodInvoker.invoke(SessionRemoteMethodInvoker.java:53)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
at com.gg.top.atm.client.ejb.AttachmentService_fcvlog_IAttachmentServiceImpl_CBV.queryAttachmentByJobTypeCodeAndObjectIdLocal(Unknown Source)
..................................................................................
Caused by: javax.transaction.TransactionRolledbackException: EJB Exception: : java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
; nested exception is:
java.lang.OutOfMemoryError: Java heap space
at weblogic.ejb.container.internal.EJBRuntimeUtils.throwTransactionRolledback(EJBRuntimeUtils.java:200)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:887)
at weblogic.ejb.container.internal.BaseRemoteObject.handleSystemException(BaseRemoteObject.java:809)
... 104 more
Caused by: java.lang.OutOfMemoryError: Java heap space
at java.util.ArrayList.<init>(ArrayList.java:112)
at com.gg.top.atm.client.attachment.dao.AttachmentDAO.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentDAO.java:1367)
at com.gg.top.atm.client.attachment.appservice.AttachmentAppService.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentAppService.java:842)
at com.gg.top.atm.client.ejb.AttachmentServiceImpl.queryAttachmentByJobTypeCodeAndObjectIdLocal(AttachmentServiceImpl.java:221)
..................................................................................
相关文章推荐
- Tomcat内存溢出解决java.lang.OutOfMemoryError: PermGen space
- java.lang.OutOfMemoryError : Java heap space
- java.lang.OutOfMemoryError: PermGen space及其解决方法
- eclipse内存溢出报错:java.lang.OutOfMemoryError:Java heap space
- java.lang.OutOfMemoryError: PermGen space
- ant 封装 时出现java.lang.OutOfMemoryError: Java heap space
- Eclipse 报java.lang.OutOfMemoryError: PermGen space错
- java.lang.OutOfMemoryError: Java heap space
- java.lang.OutOfMemoryError: Java heap space 解决方法
- 转:Tomcat-java.lang.OutOfMemoryError: PermGen
- java.lang.OutOfMemoryError: GC overhead limit exceeded
- tomcat 内存溢出 java.util.concurrent.ExecutionException: java.lang.OutOfMemoryError
- java.lang.OutOfMemoryError: PermGen
- hadoop中java.lang.OutOfMemoryError: Java heap space
- Tomcat6下应用太多出现java.lang.OutOfMemoryError: PermGen space【解决办法】
- 关于java.lang.OutOfMemoryError:java heap space错误解决方案
- 正确使用MySQL JDBC setFetchSize()方法解决JDBC处理大结果集 java.lang.OutOfMemoryError: Java heap space
- 内存不足 java.lang.OutOfMemoryError: Java heap space
- https://stackoverflow.com/questions/16130292/java-lang-outofmemoryerror-permgen-space-java-reflection