B4J Question [Abmaterial] OutOfMemoryError: Java heap space

Discussion in 'B4J Questions' started by jinyistudio, Sep 15, 2017.

  1. jinyistudio

    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.

    Code:
    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)
     
  2. alwaysbusy

    alwaysbusy Expert Licensed User

    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?
     
  3. jinyistudio

    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.
    Code:
    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: Sep 15, 2017
  4. alwaysbusy

    alwaysbusy Expert Licensed User

    It is in the ABMShared module:

    e.g.
    Code:
    Public SessionMaxInactiveIntervalSeconds As Int = 30*60 ' 30 minutes
     
    jinyistudio likes this.
  5. jinyistudio

    jinyistudio Active Member Licensed User

    Do you know how to solve this java.lang.OutOfMemoryError: Java heap space ?
     
  6. alwaysbusy

    alwaysbusy Expert Licensed User

  7. jinyistudio

    jinyistudio Active Member Licensed User

    Public SessionMaxInactiveIntervalSeconds As Int = 30*60
     
  8. alwaysbusy

    alwaysbusy Expert Licensed User

    hmm, that is weird as the KeepAlive method should only run every 15 minutes...
     
  9. jinyistudio

    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
    Code:
    D:\Customer\BSC\台豐\20170913\logs\node4-log20170912.txt (347 hits)
        Line 
    365602017-09-12 20:03:49.238:WARN:oejs.HttpChannel:qtp19275889-195602: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    365932017-09-12 20:03:54.122:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    366512017-09-12 20:10:27.052:WARN:oejs.HttpChannel:qtp19275889-195516: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367462017-09-12 20:34:49.874:WARN:oejs.HttpChannel:qtp19275889-195682: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367792017-09-12 20:34:54.458:WARN:oejs.HttpChannel:qtp19275889-195676: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367812017-09-12 20:34:57.053:WARN:oejs.HttpChannel:qtp19275889-195425: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367832017-09-12 20:34:59.350:WARN:oejs.HttpChannel:qtp19275889-195715: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367852017-09-12 20:35:01.639:WARN:oejs.HttpChannel:qtp19275889-195579: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367892017-09-12 20:36:26.716:WARN:oejs.HttpChannel:qtp19275889-195606: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367912017-09-12 20:36:37.034:WARN:oejs.HttpChannel:qtp19275889-195510: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367932017-09-12 20:36:34.742:WARN:oejs.HttpChannel:qtp19275889-195682: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367952017-09-12 20:36:32.462:WARN:oejs.HttpChannel:qtp19275889-195705: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    367972017-09-12 20:36:29.014:WARN:oejs.HttpChannel:qtp19275889-195715: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368002017-09-12 20:36:39.314:WARN:oejs.HttpChannel:qtp19275889-195689: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368022017-09-12 20:36:43.908:WARN:oejs.HttpChannel:qtp19275889-195697: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368042017-09-12 20:36:41.620:WARN:oejs.HttpChannel:qtp19275889-195731: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368072017-09-12 20:38:18.235:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368092017-09-12 20:38:21.684:WARN:oejs.HttpChannel:qtp19275889-195731: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368232017-09-12 20:44:20.629:WARN:oejs.HttpChannel:qtp19275889-195415: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368252017-09-12 20:44:31.007:WARN:oejs.HttpChannel:qtp19275889-195690: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368282017-09-12 20:45:00.850:WARN:oejs.HttpChannel:qtp19275889-195573: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368302017-09-12 20:45:04.301:WARN:oejs.HttpChannel:qtp19275889-195752: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368322017-09-12 20:45:16.897:WARN:oejs.HttpChannel:qtp19275889-195697: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368342017-09-12 20:45:13.454:WARN:oejs.HttpChannel:qtp19275889-195510: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368362017-09-12 20:45:11.150:WARN:oejs.HttpChannel:qtp19275889-195705: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368382017-09-12 20:45:08.883:WARN:oejs.HttpChannel:qtp19275889-195689: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368422017-09-12 20:46:12.056:WARN:oejs.HttpChannel:qtp19275889-195510: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368442017-09-12 20:46:17.799:WARN:oejs.HttpChannel:qtp19275889-195425: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368472017-09-12 20:47:37.141:WARN:oejs.HttpChannel:qtp19275889-195754: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368492017-09-12 20:47:41.731:WARN:oejs.HttpChannel:qtp19275889-195603: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368512017-09-12 20:47:55.503:WARN:oejs.HttpChannel:qtp19275889-195754: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368532017-09-12 20:48:03.572:WARN:oejs.HttpChannel:qtp19275889-195752: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368552017-09-12 20:48:23.094:WARN:oejs.HttpChannel:qtp19275889-195690: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368582017-09-12 20:48:20.780:WARN:oejs.HttpChannel:qtp19275889-195606: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368602017-09-12 20:48:17.337:WARN:oejs.HttpChannel:qtp19275889-195577: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368622017-09-12 20:48:05.862:WARN:oejs.HttpChannel:qtp19275889-195733: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368652017-09-12 20:48:17.337:WARN:oejs.HttpChannel:qtp19275889-195689: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368672017-09-12 20:49:03.280:WARN:oejs.HttpChannel:qtp19275889-195764: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368692017-09-12 20:49:00.977:WARN:oejs.HttpChannel:qtp19275889-195717: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368712017-09-12 20:49:12.462:WARN:oejs.HttpChannel:qtp19275889-195754: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368732017-09-12 20:48:55.233:WARN:oejs.HttpChannel:qtp19275889-195770: /dnc-node/RuncardPage/donotdelete.conn
        Line 
    368752017-09-12 20:48:51.796:WARN:oejs.HttpChannel:qtp19275889-195705: /dnc-node/RuncardPage/donotdelete.conn
    Attach file is the RuncardPage
     

    Attached Files:

    Last edited: Sep 15, 2017
  10. mindful

    mindful Active Member Licensed User

    The problem is in your RuncardPage class.

    Code:
    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 and alwaysbusy like this.
  11. jinyistudio

    jinyistudio Active Member Licensed User

    Do you know why it cause "java.lang.OutOfMemoryError: Java heap space" ?
     
  12. mindful

    mindful Active Member Licensed User

    Well besides from the fact that you need to address the issue with the keepalive mechanism ... I can't think of another issue as all the logs point to that !
     
    jinyistudio likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice