System Administration
cancel
Showing results for 
Search instead for 
Did you mean: 

Relation between ResidentSetSize of a java application and its wrapper.java.maxmemory value

 
PrasannaKumari
Contributor

Relation between ResidentSetSize of a java application and its wrapper.java.maxmemory value

How is the ResidentSetSize of a java process related to the maxmemory setting for the java application.

Can the Resident Set Size value for the java process be more than the maxMemory setting? I am seeing that the Resident Set Size for a java application on a non-server class machine is more than its maxMemory setting which is 64MB while the Resident Set Size is more than 150MB?

Should not this kind of scenario give an "OutOfMemory" error?


2 REPLIES
Steven E. Protter
Exalted Contributor

Re: Relation between ResidentSetSize of a java application and its wrapper.java.maxmemory value

Shalom,

Can the Resident Set Size value for the java process be more than the maxMemory setting?

maxMemory implies not.

This is something that does not seem to be clearly documented.

I would test this out as part of the quality assurance process. Maybe in the prototype stage.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Don Morris_1
Honored Contributor

Re: Relation between ResidentSetSize of a java application and its wrapper.java.maxmemory value

No, it doesn't imply that at all.

From:
http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Runtime.html#maxMemory()

maxMemory is the max that the JVM will use. I would have to interpret that as the maximum the JVM will allocate *itself* from heap, etc. RSS includes things that the JVM doesn't know about (like Kernel stack, shared library pages, Text pages, etc.) While the JVM could query this from time to time, it would be a moving target. (If someone else links to a shared library and faults in pages because they call a different function set... the JVM RSS shows part of the pages -- but it can't control this nor even know about it).

As such, maxMemory is more of a maxdsiz+local_shmmax type limit, not a hard cap on RSS.