1

Summary

I seem to have run into an issue where my Java Process's memory (Private Working Set) continues to climb beyond the assigned -Xmx value.

I understand that each process has several sets of memory, JVM heap being just one of them.

Although, I can't seem to find WHERE the memory buildup is coming from. I've monitored my application with VisuamVM and found that the JVM heap is not the issue.

It may be important to note that my application does use off-heap memory via DirectByteBuffers, and we dispose of these buffers by using:

((DirectBuffer) buffer).cleaner().clean();

It also may be important to note that we are using 3rd party Native dll Libraries for DirectX rendering.

JVM Flags

-Xmx384m -Xss2m -Dsun.java2d.noddraw=true -XX:CompileThreshold=1500 -Xincgc -XX:+UseConcMarkSweepGC -XX:+UseParNewGC

Monitoring

  • Before = Memory before excessive buildup.
  • After = Memory after excessive buildup.

Please note, some URL's are not embedded due to a lack of Stack Overflow reputation.

#1 - MXBeans

Source: http://middlewaremagic.com/weblogic/?p=898

Before: http://pastebin.com/EgeciZ0w

After: http://pastebin.com/fraWDwiw

#2 - Native Memory Tracking

Source: https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/tooldescr007.html

Before: http://pastebin.com/qbzZAY6m

After: http://pastebin.com/LNNu4kRj

#3 - VisualVM

Memory -> Heap: https://i.stack.imgur.com/zE5D4.png

Memory -> Metaspace: https://i.stack.imgur.com/Li2SM.png

Memory -> Private Working Set: https://i.stack.imgur.com/Mbibb.png

Conclusion

Despite all of this monitoring, I am still unable to locate the source of the memory allocation. Have I missed something, am I reading the data wrong? If the memory is being allocated on the native heap, how can I track it and monitor it?

If you need any additional information I'll be happy to provide it. Thank you for taking your time to help me with this issue!

Wonderlus
  • 331
  • 1
  • 2
  • 9
  • Are you seeing any other symptoms of this issue? I don't have much Windows experience, but could it be possible this is normal behavior? The JVM max heap size and Windows' Private Memory Set don't seem to be one and the same. Check out http://stackoverflow.com/a/5406063/285976 – Chris Fei Aug 28 '15 at 04:45
  • If you're using a lot of native code and direct byte buffers you might want to look at tools that include those figures too. Comparing native memory tracking (which only concerns JVM-internal allocations) with the complete memory map of the process might be a starting point. – the8472 Aug 28 '15 at 04:55
  • See http://stackoverflow.com/questions/26041117/growing-resident-memory-usage-rss-of-java-process – Lari Hotari Aug 25 '16 at 11:55

0 Answers0