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!