WebSphere 7 - Can Excessive Garbage Collection Lead to Out of Memory?

Problem: Coming from an exception from main memory and was wondering if it could lead to excessive garbage collection? Any guidance on policy or GC tuning would also be helpful. I'm not sure if what I guarantee will change yet.

Good StackOverflow review Question: Which GC policy to use

Specifications:

  • Server environment: Websphere Version 7
  • GC policy: default (optthruput)
  • Java 1.5
  • Heap: 8 GB
  • Working in a virtual machine
  • Analysis tool: application dynamics

Preliminary analysis:

  • I assumed a memory leak, however the garbage collection looks ok as it reclaims memory.
  • An out of native memory exception makes me think that memory outside of the VM is exhausted, however I am not sure how to do this.

Attached screenshot:

1.1 is a 4 hour heap usage period. Each little green trash can represent a major waste collection point. 1.2. The GC timeline in the above graph. 1.3. What heap usage looked like during a memory exception.

enter image description here

An exception:

EJB throws unexpected (undeclared) data ejb Exception: java.lang.OutOfMemoryError: memory wasted at garbagecollection.mycode.test at com.ibm.ws.webcontainer.servlet.ServletWrapper.service (ServletWrapper.java:1658) at com.ibm .ws.webcontainer.servlet.ServletWrapper.service (ServletWrapper.java:1598) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter (WebAppFilterChain.java:149) at com.ibm.ws.webcontainerFilter .doFilter (FilterInstanceWrapper.java:190) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter (WebAppFilterChain.java:125) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.filter.FilterInstanceWrapper.filter.FilterInstanceWrapper.filter.FilterInstanceWrapper.filter ) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter (WebAppFilterChain.java:125) at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter (FilterInstanceWrapper.java:190) at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter (WebAppFilterChain.java:125) at com.ibm.ws.webcontainer.filter.WebAppFilterFilterChain.App_doFilter.WebAppFilterFilterChain.App_doFilter at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter (WebAppFilterManager.java:908) at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest (ServletWrapper.java:935) at com.ibm. .servlet.ServletWrapper.handleRequest (ServletWrapper.java:503) at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest (ServletWrapperImpl.java:181) at com.ibm.ws.webcontainer.vservlet.CacheServlet .java: 91) at com.ibm.ws.webcontainer.WebContainer.handleRequest (WebContainer.java:875) at com.ibm.ws.webcontainer.WSWebContainer.handleRequest (WSWebContainer.java:1592) at com.ibm.ws.webcontainer.channel.WCChannelLink.ready (WCChannelLink.java:186) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination (HttpInboundLink ).java .ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest (HttpInboundLink.java:515) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest (HttpInbava6:30) at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest (HttpInbava6:30) .ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete (HttpICLReadCallback.java:83) at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext $ SSLReadCompletedCallback.complete (SSLReadVervice) .ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted (AioReadCompletionListener.java:165) at com.ibm.io.async.AbstractAsyncFuture.invokeCallback (AbstractAsyncFuture.java:217) at com.ibm.io.async. ...fireCompletionActions (AsyncChannelFuture.java:161) at com.ibm.io.async.AsyncFuture.completed (AsyncFuture.java:138) at com.ibm.io.async.ResultHandler.complete (ResultHandler.java:204) at com.ibm .io.async.ResultHandler.runEventProcessingLoop (ResultHandler.java:775) at com.ibm.io.async.ResultHandler $ 2.run (ResultHandler.java:905) at com.ibm.ws.util.ThreadPool $ Worker.run ( ThreadPool.java:1646)

+3


source to share


1 answer


The error message that you see indicates a problem with native memory, that is, memory outside the heap. The garbage collector is not responsible for inactive memory, so you cannot influence this error with the garbage collector settings. Excessive garbage collection should not lead to problems with internal memory (unless, of course, there is a bug in the GC).

What is causing this particular error is difficult to tell without additional information. Am I assuming the computer has at least 12GB of RAM? Otherwise, you are just running a heap that is too big for the available memory.

Some examples of things in Java that can call on-board memory:

  • Native code leaks (JNI)

  • Direct selection of many ByteBuffer

    s

Or maybe there is no leak, this behavior is expected for your application and you only need to allow larger processes or buy some more memory.



The first step to solving the problem is to test the size of the process against possible process size limits. You could just run a limit like this without actually leaking.

If that's not a problem, monitor the size of the process over time, especially in terms of available memory, to see if you have leaky behavior.

If you really think you have a memory leak, determine which libraries are using the JNI you are using (for example JDBC drivers) and try to replace them with Java-only versions. In addition, check for known memory leak errors in such libraries, as well as the JVM version and WebSphere version.

If that doesn't work, you will have to resort to memory leak troubleshooters. This is another question.

+2


source







All Articles