[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17240913#comment-17240913 ] Simon Levesque commented on JAMES-3451: --- On my side, I am using the MaridDB driver. I switched the DataSource that I provide in Guice from MariaDbPoolDataSource to BasicDataSource from the commons-dbcp. It has been running for the last 2 days and it didn't have to restart. Normally, I reach 4G of memory used in a bit less than 24 hours. So, thanks for the tip. I just have one question. There is still one place where I must put the driver directly: the james-database.properties file ( [https://github.com/foilen/foilen-email-server/blob/dev/src/main/resources/com/foilen/email/server/james/conf/james-database.properties.ftl] ) Is that file: * used only once? (if yes, then that is fine since it won't build up any memory leak) * if used more than once, is there a way to provide a datapool? thanks > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] >
[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17239565#comment-17239565 ] Benoit Tellier commented on JAMES-3451: --- Thanks for the report. Shall we close this ticket? > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] > [elastic-1226] (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is > null, boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.391 [ERROR] > [elastic-1226] (o.a.j.m.e.delivery.InVmEventDelivery:71) - Error while > processing listenerjava.lang.RuntimeException: java.lang.NullPointerException > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.doDeliverToListener(InVmEventDelivery.java:86) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.lambda$deliverByOption$1(InVmEventDelivery.java:69) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery$$Lambda$866/2127037983.run(Unknown > Source) at >
[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17239480#comment-17239480 ] owenzhu commented on JAMES-3451: Maybe it is a mysql Connector/J bug.I used the ConnectionPool(commons-dbcp-1.4), and the service ran for three days without any memory leaks.[https://stackoverflow.com/questions/12240899/memory-leak-application-using-jdbc|https://stackoverflow.com/questions/12240899/memory-leak-application-using-jdbc] > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] > [elastic-1226] (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is > null, boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.391 [ERROR] > [elastic-1226] (o.a.j.m.e.delivery.InVmEventDelivery:71) - Error while > processing listenerjava.lang.RuntimeException: java.lang.NullPointerException > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.doDeliverToListener(InVmEventDelivery.java:86) > at >
[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17237954#comment-17237954 ] owenzhu commented on JAMES-3451: maybe it is a mysql driver bug [链接标题|[https://stackoverflow.com/questions/12240899/memory-leak-application-using-jdbc]]. I use a ConnectionPool(commons-dbcp-1.4) and restart the server , the heap memory is stable now. > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] > [elastic-1226] (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is > null, boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.391 [ERROR] > [elastic-1226] (o.a.j.m.e.delivery.InVmEventDelivery:71) - Error while > processing listenerjava.lang.RuntimeException: java.lang.NullPointerException > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.doDeliverToListener(InVmEventDelivery.java:86) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.lambda$deliverByOption$1(InVmEventDelivery.java:69) > at >
[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17236760#comment-17236760 ] Simon Levesque commented on JAMES-3451: --- I also use JPA with MariaDB and I have to restart daily because of these memory leaks. I fixed some in the past (JAMES-3026), but still, it happens. This is the only project I know that uses OpenJPA. For all the other projects where I use JPA, I use Hibernate and it is very stable. I wonder how big of a change it would be to switch to Hibernate and if that could solve all these issues. > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] > [elastic-1226] (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is > null, boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.391 [ERROR] > [elastic-1226] (o.a.j.m.e.delivery.InVmEventDelivery:71) - Error while > processing listenerjava.lang.RuntimeException: java.lang.NullPointerException > at >
[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17234458#comment-17234458 ] owenzhu commented on JAMES-3451: I did not test for other databases. I didn't change the other code except for the configuration file. > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] > [elastic-1226] (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is > null, boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.391 [ERROR] > [elastic-1226] (o.a.j.m.e.delivery.InVmEventDelivery:71) - Error while > processing listenerjava.lang.RuntimeException: java.lang.NullPointerException > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.doDeliverToListener(InVmEventDelivery.java:86) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.lambda$deliverByOption$1(InVmEventDelivery.java:69) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery$$Lambda$866/2127037983.run(Unknown > Source) at >
[jira] [Commented] (JAMES-3451) james 3.5.0 OutOfMemoryError
[ https://issues.apache.org/jira/browse/JAMES-3451?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=17234383#comment-17234383 ] Benoit Tellier commented on JAMES-3451: --- Does it happen only for mysql? Can you submit a patch for this? > james 3.5.0 OutOfMemoryError > > > Key: JAMES-3451 > URL: https://issues.apache.org/jira/browse/JAMES-3451 > Project: James Server > Issue Type: Bug > Components: mailbox >Affects Versions: 3.5.0 > Environment: aliyun linux & mysql 8 & jpa-guice >Reporter: owenzhu >Priority: Major > Attachments: bigobject.png, thread.png > > > database: mysql8 > platform: aliyun linux > jvm params: -Xms128m -Xmx2560m > When I run the James for a long time, the james server used more and more > heap memory, eventually it runs out of memory and refuse to receive email. > only restart the james will work. > java.lang.OutOfMemoryError: Java heap spacejava.lang.OutOfMemoryError: Java > heap space at com.mysql.jdbc.MysqlIO.nextRowFast(MysqlIO.java:2173) at > com.mysql.jdbc.MysqlIO.nextRow(MysqlIO.java:1992) at > com.mysql.jdbc.MysqlIO.readSingleRowSet(MysqlIO.java:3413) at > com.mysql.jdbc.MysqlIO.getResultSet(MysqlIO.java:471) at > com.mysql.jdbc.MysqlIO.readResultsForQueryOrUpdate(MysqlIO.java:3115) at > com.mysql.jdbc.MysqlIO.readAllResults(MysqlIO.java:2344) at > com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2739) at > com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2486) at > com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858) > at com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1966) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:302) > at > org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1169) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:300) > at > org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1866) > at > org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:290) > at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:530) > at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:455) at > org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:422) at > org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:472) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:254) > at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:243) at > org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:95) > at > org.apache.openjpa.lib.rop.EagerResultList.(EagerResultList.java:36) at > org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1311) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1062) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:912) at > org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:843) at > org.apache.openjpa.kernel.DelegatingQuery.execute(DelegatingQuery.java:601) > at org.apache.openjpa.persistence.QueryImpl.execute(QueryImpl.java:297) at > org.apache.openjpa.persistence.QueryImpl.getResultList(QueryImpl.java:314) at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findMessagesInMailbox(JPAMessageMapper.java:421) > at > org.apache.james.mailbox.jpa.mail.JPAMessageMapper.findAsList(JPAMessageMapper.java:113) > I used jProfile to parse the dump file and found that many transactions were > waiting.See the attached screenshot for details. > In addition, I will find the following error in the log, I don't know whether > it is the cause of OOM, ApplicableFlags is null in debug : > 2020-11-17 21:41:00.390 [ERROR] [elastic-1226] > (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is null, > boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.390 [ERROR] > [elastic-1226] (o.a.j.i.p.base.SelectedMailboxImpl:367) - applicableFlags is > null, boxId=130656, mail=udysk@88mail.vip2020-11-17 21:41:00.391 [ERROR] > [elastic-1226] (o.a.j.m.e.delivery.InVmEventDelivery:71) - Error while > processing listenerjava.lang.RuntimeException: java.lang.NullPointerException > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.doDeliverToListener(InVmEventDelivery.java:86) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery.lambda$deliverByOption$1(InVmEventDelivery.java:69) > at > org.apache.james.mailbox.events.delivery.InVmEventDelivery$$Lambda$866/2127037983.run(Unknown > Source) at >