How can I figure out what anonymous memory is being used for?
问题 I have a program which is not running out of heap but for which the use of anonymous/native memory grows and grows. How can I go about figuring out what is using this memory? 回答1: Inspect a heap dump for DirectByteBuffer objects and what's holding onto them. File mappings would also be a cause, but you say anonymous mappings so that's probably not the issue here since those would be named. For some things native memory tracking may be useful too. If it's neither DirectByteBuffer instances nor