The part of memory Java doesn't tell you about

Java doesn't just use heap. The JVM also allocates:

Metaspace — class metadata, loaded by the JVM itself

Code cache — JIT-compiled native code

Thread stacks — each thread gets its own