Memory profiling with java and native libraries

I have a Java application that uses LWJGL and a couple of my own native libraries. I’ve been able to do some memory profiling with Java Mission Control, CodeXL (for OpenGL) and LWJGL’s memReport(), but this doesn’t give me the complete picture, and there’s about 100 MiB for which I can’t account. I’d like a clear idea of what’s going on outside of the Java heap.

How do you guys profile your games’ memory usage? What tools have you found to work well (particularly on Windows)?

JVisualVM is free and works well!

VisualVM is nice, though in my experience inferior to jmc. The flight recorder seems to give much better information with a fraction of the overhead of VisualVM. (But anyway, neither will tell you about what’s going on outside the Java heap, afaik.)

There’s a plugin for JVisualVM to examine the native heap but I don’t remember where it is :s

You can use -XX:NativeMemoryTracking with Java 1.8 too.

In my dayjob I used jemalloc in the past:

I use RenderDoc to track GPU performance.