ubuntu - In Java, Heap Memory vs System Memory -


i have java process running on ubuntu os, per jconsole shows heap memory 150 mb same process "system monitor" in ubuntu shows approx. 470 mb. when check size of jars in classpath comes around 200 mb.

i considering jars present in classpath loaded in jvm particular process.

please can 1 me understand? ... missing on something?

ubuntu system manager shows totally memory occupied jre(java runtime environment). jre contains other memory such stack memory(native & java stacks), code memory(where java classes , code present), along heap memory. thus, heap memory jconsole less it's shown memory manager. moreover, jre manages memory on own, independent of os. thus, may possible has acquired more memory os, program @ present requiring less memory. so, it's holding whenever next time program requires more memory, doesn't have go os request more memory. because system calls requesting more memory os expensive.

coming jar loading question. jars, present in classpath may not loaded jre. they'll loaded on demand basis. thus, may happen there're 100 jars in classpath, 2 classes in 1 of jars loaded. thus, 2 classes loaded in memory.

for performing more sophisticated memory analysis, recommend use jvisualvm, comes several plugins, analyze memory in program.


Comments

Popular posts from this blog

aws api gateway - SerializationException in posting new Records via Dynamodb Proxy Service in API -

asp.net - Problems sending emails from forum -