Reputation: 2953
I am running load through my java program and analyzing memory consumption through jconsole and top command.
"uname -a" machine on which i am working is :
SunOS 5.10 Generic_142909-17 sun4v sparc sun4v
My issue is that if i see memory consumption through top command then RES mem increases when load is running,which is fine but it does not come down when i stop the load.
If GC occurs then also RES mem does not come down.Opposite to that in Jconsole, I can see that mem consumption comes down when GC occurs.
TOP OUTPUT :
PID USERNAME LWP PRI NICE SIZE RES STATE TIME CPU COMMAND
16959 aconyx 836 59 0 7559M 3696M sleep 61:27 0.04% java
JConsole Output :
At same point in time jconsole showing 384 MB used and top RES showing 3696 MB used.
Any pointers why top RES memory does not come down like visible in jconsole.
Thanks in advance.
Upvotes: 0
Views: 982
Reputation: 29977
The importat bit to know is that the java GC doesn't free the memory to the OS, it just frees it so it can be reused by the JVM.
Upvotes: 2