We have a webapp running on jboss. I have a 3 gig machine and my java options in run.bat script are
jvm process memory when i observed in task bar starts normal but increases over 1 gig as i do opertations on web app. And it almost never decreases even if the heap memory is decreased. I used visual VM tool to invoke the GC and the heap comes down from say 800mb to like 200 mb. But the jvm process memory is still stays where it was at,say 1.2 gig.. No decrease in JVM process memory. How do we say to JVM that if you dont need lot of memory for yourself, just release it to the OS. Increase of JVM process memory has big affect on my web app performance..
Sagar, I noticed that in your server start script -Xms & -Xmx size is same.
This means that heap will always be at 1 GB & JVM will take this much of process memory no matter how much java heap is used by your application.
Decrease the -Xms option & try setting it to 512m.
You also need to do some more analysis of GC activity. You can enable GC logging, this will then give you an idea about how much heap is used,
frequency of GC, time spent on GC, etc. Based on this you can fine tune -Xms & -Xmx further.
As far as my understanding goes, there is no concept of returning the memory back to OS.
Thus the JVM memory size will not increase once it gets memory from OS. GC affects only heap size not the JVM memory.