B4J Question [Abmaterial] OutOfMemoryError: Java heap space

jinyistudio

Active Member
Licensed User
Hi

My application had run 14 day. I get lots of following message yestoday and the application lag very much.

B4X:
2017-09-12 20:03:49.238:WARN:oejs.HttpChannel:qtp19275889-195602: /dnc-node/RuncardPage/donotdelete.conn
java.lang.OutOfMemoryError: Java heap space
    at org.eclipse.jetty.util.IO.copy(IO.java:149)
    at org.eclipse.jetty.util.resource.Resource.writeTo(Resource.java:682)
    at org.eclipse.jetty.server.ResourceService.sendData(ResourceService.java:680)
    at org.eclipse.jetty.server.ResourceService.doGet(ResourceService.java:294)
    at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:458)
    at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:288)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:704)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:564)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
    at java.lang.Thread.run(Unknown Source)
2017-09-12 20:03:54.122:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
java.lang.OutOfMemoryError: Java heap space
    at org.eclipse.jetty.util.IO.copy(IO.java:149)
    at org.eclipse.jetty.util.resource.Resource.writeTo(Resource.java:682)
    at org.eclipse.jetty.server.ResourceService.sendData(ResourceService.java:680)
    at org.eclipse.jetty.server.ResourceService.doGet(ResourceService.java:294)
    at org.eclipse.jetty.servlet.DefaultServlet.doGet(DefaultServlet.java:458)
    at javax.servlet.http.HttpServlet.doHead(HttpServlet.java:288)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:704)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:841)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:535)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1595)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:188)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1253)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:168)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:473)
    at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1564)
    at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:166)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1155)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:126)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132)
    at org.eclipse.jetty.server.Server.handle(Server.java:564)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:317)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
    at java.lang.Thread.run(Unknown Source)
 

alwaysbusy

Expert
Licensed User
donotdelete.conn
This is normally done by the 'KeepAlive" system. However, looking at the timestamps (20:03:49 and 20:03:54), it looks like your SessionMaxInactiveIntervalSeconds must be very short (about 10 seconds, as KeepAlive is run half that time). Is this correct? Do you have some indecation on how many users the app has at any time?
 

jinyistudio

Active Member
Licensed User
the page of RuncardPage has a 1 second timer update content

How(Where) to know how much is SessionMaxInactiveIntervalSeconds ?

I think it have 1~3 user.

The application is down when i get last massage as following.
B4X:
2017-09-12 21:55:43.182:WARN:oejs.HttpChannel:qtp19275889-195855: /dnc-node/RuncardPage/donotdelete.conn
java.lang.IllegalArgumentException: Self-suppression not permitted
Caused by:
java.lang.OutOfMemoryError: Java heap space
2017-09-12 21:55:44.337:WARN:oejs.HttpChannel:qtp19275889-195855: ERROR dispatch failed
java.lang.IllegalArgumentException: Self-suppression not permitted
Suppressed:
    |java.lang.IllegalStateException: Error already set
    |    at org.eclipse.jetty.server.HttpChannelState.onError(HttpChannelState.java:753)
    |    at org.eclipse.jetty.server.HttpChannel.handleException(HttpChannel.java:522)
    |    at org.eclipse.jetty.server.HttpChannelOverHttp.handleException(HttpChannelOverHttp.java:463)
    |    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:458)
    |    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:251)
    |    at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:279)
    |    at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:110)
    |    at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:124)
    |    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:673)
    |    at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:591)
    |    at java.lang.Thread.run(Unknown Source)
    |Caused by:
    |java.lang.OutOfMemoryError: Java heap space
Caused by:
java.lang.OutOfMemoryError: Java heap space
 
Last edited:

jinyistudio

Active Member
Licensed User
Do you know how to solve this java.lang.OutOfMemoryError: Java heap space ?
 

jinyistudio

Active Member
Licensed User
Public SessionMaxInactiveIntervalSeconds As Int = 30*60
 

jinyistudio

Active Member
Licensed User
My app create a log file everyday. Why I got following messages just in th 9/12 ?

I have lots of message
B4X:
D:\Customer\BSC\台豐\20170913\logs\node4-log20170912.txt (347 hits)
    Line 36560: 2017-09-12 20:03:49.238:WARN:oejs.HttpChannel:qtp19275889-195602: /dnc-node/RuncardPage/donotdelete.conn
    Line 36593: 2017-09-12 20:03:54.122:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
    Line 36651: 2017-09-12 20:10:27.052:WARN:oejs.HttpChannel:qtp19275889-195516: /dnc-node/RuncardPage/donotdelete.conn
    Line 36746: 2017-09-12 20:34:49.874:WARN:oejs.HttpChannel:qtp19275889-195682: /dnc-node/RuncardPage/donotdelete.conn
    Line 36779: 2017-09-12 20:34:54.458:WARN:oejs.HttpChannel:qtp19275889-195676: /dnc-node/RuncardPage/donotdelete.conn
    Line 36781: 2017-09-12 20:34:57.053:WARN:oejs.HttpChannel:qtp19275889-195425: /dnc-node/RuncardPage/donotdelete.conn
    Line 36783: 2017-09-12 20:34:59.350:WARN:oejs.HttpChannel:qtp19275889-195715: /dnc-node/RuncardPage/donotdelete.conn
    Line 36785: 2017-09-12 20:35:01.639:WARN:oejs.HttpChannel:qtp19275889-195579: /dnc-node/RuncardPage/donotdelete.conn
    Line 36789: 2017-09-12 20:36:26.716:WARN:oejs.HttpChannel:qtp19275889-195606: /dnc-node/RuncardPage/donotdelete.conn
    Line 36791: 2017-09-12 20:36:37.034:WARN:oejs.HttpChannel:qtp19275889-195510: /dnc-node/RuncardPage/donotdelete.conn
    Line 36793: 2017-09-12 20:36:34.742:WARN:oejs.HttpChannel:qtp19275889-195682: /dnc-node/RuncardPage/donotdelete.conn
    Line 36795: 2017-09-12 20:36:32.462:WARN:oejs.HttpChannel:qtp19275889-195705: /dnc-node/RuncardPage/donotdelete.conn
    Line 36797: 2017-09-12 20:36:29.014:WARN:oejs.HttpChannel:qtp19275889-195715: /dnc-node/RuncardPage/donotdelete.conn
    Line 36800: 2017-09-12 20:36:39.314:WARN:oejs.HttpChannel:qtp19275889-195689: /dnc-node/RuncardPage/donotdelete.conn
    Line 36802: 2017-09-12 20:36:43.908:WARN:oejs.HttpChannel:qtp19275889-195697: /dnc-node/RuncardPage/donotdelete.conn
    Line 36804: 2017-09-12 20:36:41.620:WARN:oejs.HttpChannel:qtp19275889-195731: /dnc-node/RuncardPage/donotdelete.conn
    Line 36807: 2017-09-12 20:38:18.235:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
    Line 36809: 2017-09-12 20:38:21.684:WARN:oejs.HttpChannel:qtp19275889-195731: /dnc-node/RuncardPage/donotdelete.conn
    Line 36823: 2017-09-12 20:44:20.629:WARN:oejs.HttpChannel:qtp19275889-195415: /dnc-node/RuncardPage/donotdelete.conn
    Line 36825: 2017-09-12 20:44:31.007:WARN:oejs.HttpChannel:qtp19275889-195690: /dnc-node/RuncardPage/donotdelete.conn
    Line 36828: 2017-09-12 20:45:00.850:WARN:oejs.HttpChannel:qtp19275889-195573: /dnc-node/RuncardPage/donotdelete.conn
    Line 36830: 2017-09-12 20:45:04.301:WARN:oejs.HttpChannel:qtp19275889-195752: /dnc-node/RuncardPage/donotdelete.conn
    Line 36832: 2017-09-12 20:45:16.897:WARN:oejs.HttpChannel:qtp19275889-195697: /dnc-node/RuncardPage/donotdelete.conn
    Line 36834: 2017-09-12 20:45:13.454:WARN:oejs.HttpChannel:qtp19275889-195510: /dnc-node/RuncardPage/donotdelete.conn
    Line 36836: 2017-09-12 20:45:11.150:WARN:oejs.HttpChannel:qtp19275889-195705: /dnc-node/RuncardPage/donotdelete.conn
    Line 36838: 2017-09-12 20:45:08.883:WARN:oejs.HttpChannel:qtp19275889-195689: /dnc-node/RuncardPage/donotdelete.conn
    Line 36842: 2017-09-12 20:46:12.056:WARN:oejs.HttpChannel:qtp19275889-195510: /dnc-node/RuncardPage/donotdelete.conn
    Line 36844: 2017-09-12 20:46:17.799:WARN:oejs.HttpChannel:qtp19275889-195425: /dnc-node/RuncardPage/donotdelete.conn
    Line 36847: 2017-09-12 20:47:37.141:WARN:oejs.HttpChannel:qtp19275889-195754: /dnc-node/RuncardPage/donotdelete.conn
    Line 36849: 2017-09-12 20:47:41.731:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
    Line 36851: 2017-09-12 20:47:55.503:WARN:oejs.HttpChannel:qtp19275889-195754: /dnc-node/RuncardPage/donotdelete.conn
    Line 36853: 2017-09-12 20:48:03.572:WARN:oejs.HttpChannel:qtp19275889-195752: /dnc-node/RuncardPage/donotdelete.conn
    Line 36855: 2017-09-12 20:48:23.094:WARN:oejs.HttpChannel:qtp19275889-195690: /dnc-node/RuncardPage/donotdelete.conn
    Line 36858: 2017-09-12 20:48:20.780:WARN:oejs.HttpChannel:qtp19275889-195606: /dnc-node/RuncardPage/donotdelete.conn
    Line 36860: 2017-09-12 20:48:17.337:WARN:oejs.HttpChannel:qtp19275889-195577: /dnc-node/RuncardPage/donotdelete.conn
    Line 36862: 2017-09-12 20:48:05.862:WARN:oejs.HttpChannel:qtp19275889-195733: /dnc-node/RuncardPage/donotdelete.conn
    Line 36865: 2017-09-12 20:48:17.337:WARN:oejs.HttpChannel:qtp19275889-195689: /dnc-node/RuncardPage/donotdelete.conn
    Line 36867: 2017-09-12 20:49:03.280:WARN:oejs.HttpChannel:qtp19275889-195764: /dnc-node/RuncardPage/donotdelete.conn
    Line 36869: 2017-09-12 20:49:00.977:WARN:oejs.HttpChannel:qtp19275889-195717: /dnc-node/RuncardPage/donotdelete.conn
    Line 36871: 2017-09-12 20:49:12.462:WARN:oejs.HttpChannel:qtp19275889-195754: /dnc-node/RuncardPage/donotdelete.conn
    Line 36873: 2017-09-12 20:48:55.233:WARN:oejs.HttpChannel:qtp19275889-195770: /dnc-node/RuncardPage/donotdelete.conn
    Line 36875: 2017-09-12 20:48:51.796:WARN:oejs.HttpChannel:qtp19275889-195705: /dnc-node/RuncardPage/donotdelete.conn
Attach file is the RuncardPage
 

Attachments

Last edited:

mindful

Active Member
Licensed User
The problem is in your RuncardPage class.

B4X:
public Sub BuildPage()
    ' initialize the theme   
    BuildTheme
    ' initialize this page using our theme
    page.InitializeWithTheme(Name, "/ws/" & AppName & "/" & Name, False,3, theme)
Instead of "3" it should have been ABMShared.SessionMaxInactiveIntervalSeconds .... that parameter makes the browser sent keepalive request for session at an interval of half of what you put in there .... So in your case because you put 3 in there ... the browser sent a request every second.
 

jinyistudio

Active Member
Licensed User
Do you know why it cause "java.lang.OutOfMemoryError: Java heap space" ?
 
Top