3

I am investigating the slowness in our application and eventually one of the instances in a cluster environment going down. Few weeks back I came across the error below:

[#|2012-05-11T14:12:03.460-0400|SEVERE|sun-appserver2.1|javax.enterprise.system.container.web|_ThreadID=89;_ThreadName=httpSSLWorkerThread-7311-0;_RequestID=7afaee11-c970-40dd-b5fb-29498af8e512;|StandardWrapperValve[LoginModule]: PWC1406: Servlet.service() for servlet LoginModule threw exception
java.lang.OutOfMemoryError: GC overhead limit exceeded

I figured that since GC overhead limit was exceeding, it had something to do with my application. There is a report that is really intensive on putting records in excel using POI, so I thought that might be causing it. As a short term fix, until next release, we informed 1 user who had access to this report to not access it.

However, today, two weeks later again one of the instances went down and upon searching the logs I found the error below:

[#|2012-06-05T10:31:36.532-0400|SEVERE|sun-appserver2.1|net.jxta.impl.endpoint.mcast.McastTransport|_ThreadID=141;_ThreadName=IP Multicast Listener for mcast://228.8.10.93:31676;_RequestID=90caf76e-b740-4f11-8ffe-8ab88a740569;|Uncaught Throwable in thread :IP Multicast Listener for mcast://228.8.10.93:31676
java.lang.OutOfMemoryError: Java heap space
|#]

Please note the difference in GC overhead limit exceeded vs. Java heap space. I am trying to find out whether the error I saw today is caused by the same reason of the user accessing the report, however, I believe if that were the case then I would see GC overhead limit exceeded.

I believe the error today is more related to the configuration of the server.

please help in clarifying.

Donal Fellows
  • 133,037
  • 18
  • 149
  • 215
Anthony
  • 33,838
  • 42
  • 169
  • 278
  • It's likely that the cause of both errors are the same. – MRalwasser Jun 05 '12 at 17:25
  • You should profile your application and check the memory leaks it has. This is a problem about your whole application consuming lot of memory, and the Apache POI Excel generation might just cause one of the biggest memory problems. – Luiggi Mendoza Jun 05 '12 at 18:51
  • What I don't understand is exactly in which case which error is thrown? shouldn't GC Overhead limit exceeded thrown all the time before we hit Heap space error? From what I understand, if GC cannot recover more than 2% in 98% of the time, mostly the heap is full. isn't it? – endless Mar 12 '13 at 03:22

2 Answers2

2

The first error "GC Overhead" means that GC is taking large portion of CPU cycle, mostly it means 98% or 99% and in each run it is releasing very less memory 1-2%.

The second error means your application went out of memory during some processing.

Also your investigation is correct of POI using up too much of memory, POI has a history of extra memory consumption.

Came across a very good discussion on SO

Community
  • 1
  • 1
mprabhat
  • 20,107
  • 7
  • 46
  • 63
  • POI? I understand that the GC issue happened because CPU did not get enough time to release memory, but is it the same in the second stacktrace as well? – Anthony Jun 05 '12 at 17:30
  • 2nd one is not because of CPU cycle, it's because while your application was running it ran out of memory, may be GC didn't run. Second error can be corrected by adding some extra memory or correcting the code. – mprabhat Jun 05 '12 at 17:32
  • If you can get rid of Java Heap Issue, more or else your first issue will also get resolved. – mprabhat Jun 05 '12 at 17:56
  • 1
    It seems there is a memory leak in your application. – Amir Pashazadeh Jun 05 '12 at 18:23
0

There is a good discussion on a similar topic here. It is basically caused when a lot of time is consumed by GC but very little memory is recovered.

Community
  • 1
  • 1
Jatin
  • 31,116
  • 15
  • 98
  • 163