Re: [vcap-dev] Java OOM debugging


Lari Hotari <Lari@...>
 

On 15-05-14 10:23 AM, Daniel Jones wrote:
Do you know how Tomcat's APR/NIO memory gets allocated? Is there a way
of telling from pmap whether pages are being used for NIO buffers or
by the APR?
The JVM has Native Memory Tracking (NMT), but I've never used it. Here
are some details about it:
http://hirt.se/blog/?p=401
http://docs.oracle.com/javase/8/docs/technotes/guides/vm/nmt-8.html
http://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html#BABIIIAC
By using NMT, you can find out what memory regions are used by the JVM.
That would help finding out what areas of the pmap report aren't tracked
by NMT and NMT reports will give insight what the tracked memory is used
for.

I assume that won't track any allocations made in custom native
libraries like the Tomcat native library.
The native memory used by zip handling in the JVM doesn't seem to be
tracked either:
http://hg.openjdk.java.net/jdk8u/jdk8u/jdk/file/a006fa0a9e8f/src/share/native/java/util/zip/zip_util.c#l627
The "-Dsun.zip.disableMemoryMapping=true" setting changes how memory
allocation is done in the zip functions of the JDK. It doesn't get rid
of native memory allocations, but just makes it not use mmap. I'm not
sure if that leads to anything useful, but it's worth trying if you have
a good test environment.

Lari

Join cf-dev@lists.cloudfoundry.org to automatically receive all group messages.