I was running an java application in unix machines , during load for 20 hrs in last 5 hrs every 1 hour virtual memory is increasing by 2 MB though RES memory is stable so my friend is saying the application has memory leak..below is a hour wise load stat using top command. my question is 1.) whether increase in virtual memory means memory leak? 2.) Which column in top stats has to be considered for memory usage?.
Thanks for your reply. Xmx and Xms are not set. My question whether increase in Virtual memory can be considered as memory leak. since most of the time we measure only RES memory. Please suggest me.
I would personally be watching the virtual memory total rising with regards to potential leaks .
Given your JVM settings or lack of and the figures your showing me I can't say if you have a leak or not. If you are at all concerned about leaks I would strongly suggest you collect GC logs and plot them using something like gcviewer. In an application concerned with performance I would normally expect you to set Xmx/Xms (and to the same value).
"Eagles may soar but weasels don't get sucked into jet engines" SCJP 1.6, SCWCD 1.4, SCJD 1.5,SCBCD 5
You can use the flag "java -XX:+PrintFlagsFinal" to show all possible flags and it also prints all the default values for the flags being set. For details see here: JVM Memory Arguments For a verbose gc output you can use "-verbose:gc". Details see here: garbage collection - part 1 and 2