Top command reflects the total amount of memory used by the Java application. This includes among other things:
- A basic memory overhead of the JVM itself
- the heap space (bounded with -Xmx)
- The permanent generation space (-XX:MaxPermSize – not standard in all JVMs)
- threads stack space (-Xss per stack) which may grow significantly depending on the number of threads
- Space used by native allocations (using ByteBufer class, or JNI)