Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

java -Xms<val> -Xmx<val> uses more memory than allocated

807591Sep 26 2007 — edited May 29 2008
We are using Java 1.5 (1.5.0_10-b03) on a 64bit Solaris 10 server.

The application is started like this:

java -Xms64m -Xmx128m TheJavaProgram

We run a "ps -eo pid,rss,vsz,args,tty" (report process status) which ends up reporting the "vsz" (virtual memory in kb) for the java as:

163,272k

That number is well above the 131k that 128m would equate to.

Furthermore, when we run additional tests like that, with new params for the -Xms and -Xmx, it gets worse. For example:

java -Xms64m -Xmx64m TheJavaProgram

Yields:

155,840k

This is far above the 128m max.

We tried the same tests by switching the call to "TheJavaProgram" to a simple "-version" and got the same results.

We are running 64bit, but have tried both the 32 bit and 64 bit java versions.

On windows, there are similar results, just not as drastic. In windows, the call to java like this:

java -Xms64m -Xmx128m TheJavaProgram

Yielded:

132,901k

The number should have been around 131,072k. Not so bad a difference, but yet not the result desired.

The big problem is on Solaris when we want to max it out at 64m. It ends up use 155m.

Any ideas?

Thank you,
Gary
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jun 26 2008
Added on Sep 26 2007
9 comments
608 views