Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Virtual Machine / March 2004

Tip: Looking for answers? Try searching our database.

MaxPermSize for 1.3.1 JVM

Thread view: 
Tony Farne - 04 Mar 2004 05:01 GMT
Anyone know for sure whether MaxPermSize is memory that gets added to
the total heap size or, whether it's a fraction of whatever you define
as heap?

For example, if you set -Xmx256m and MaxPermSize=128m - are you
looking at a total of 256+128 megs of thinking space?  Or, are you
looking at 128m being assigned to the perm space with the remaining
128m (256-128) all that's left available to both the old and new
generations?

Get this: Sun told me today in e-mail that they're ADDITIVE, and
visually...according to their GC document...this just doesn't make
sense.  Thought it was time to seek input from the experts.  ;)

TIA!

-- Tony
Moazam Raja - 05 Mar 2004 06:37 GMT
(sorry for the long winded response, but I think it's needed as this is
indeed a very confusing topic)

Yes, PermSize is additional to the -Xmx value set by the user on the JVM
options. But MaxPermSize allows for the JVM to be able to grow the
PermSize to the amount specified. Initially when the VM is loaded, the
MaxPermSize will still be the default value (32mb for -client and 64mb
for -server) but will not actually take up that amount until it is
needed. On the other hand, if you were to set BOTH PermSize and
MaxPermSize to 256mb, you would notice that the overall heap has
increased by 256mb additional to the -Xmx setting.

So for example, if you set your -Xmx to 256m and your -MaxPermSize to
256m, you could check with the Solaris 'pmap' command how much memory
the resulting process is taking up.

i.e.,

$ uname -a
SunOS devnull 5.8 Generic_108528-27 sun4u sparc SUNW,UltraSPARC-IIi-cEngine

$ java -version
java version "1.3.1_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.3.1_02-b02)
Java HotSpot(TM) Client VM (build 1.3.1_02-b02, mixed mode)

---------------------------------------------
$ java -Xms256m -Xmx256m -XX:MaxPermSize=256m Hello &
$ pmap 6432
6432:   /usr/java1.3.1/bin/../bin/sparc/native_threads/java -Xms256m
-Xmx256m

 total   288416K
---------------------------------------------
Notice above that the overall heap is not 256m+256m yet? Why? We did not
specify PermSize yet, only MAXPermSize.

---------------------------------------------
$ java -Xms256m -Xmx256m -XX:PermSize=256m -XX:MaxPermSize=256m Hello &
$ pmap 6472
6472:   /usr/java1.3.1/bin/../bin/sparc/native_threads/java -Xms256m
-Xmx256m

 total   550544K
---------------------------------------------
Now we see the overall heap grow, -Xmx+PermSize. This shows that
PermSize and MaxPermSize are additional to the -Xmx setting.

The GC document you are referring to
(http://java.sun.com/docs/hotspot/gc/) has a diagram ("Sizing the
generations")which conveys the overall heap and MaxPermSize in a pretty
confusing manner. The more I look at it the more I think the original
author has made a subtle mistake in describing -Xmx as it relates to the
PermSize and MaxPermSize.

-Moazam

> Anyone know for sure whether MaxPermSize is memory that gets added to
> the total heap size or, whether it's a fraction of whatever you define
[quoted text clipped - 13 lines]
>
> -- Tony
Tony Farne - 06 Mar 2004 05:55 GMT
Thanks for the clarification, Moazam.  (Your name looks/sounds very
familiar to me...unixville = _ _ _, methinks).

Yep...it was the figure at the URL you mentioned.  That, as well as
the accompanying explanatory text.  Before going into the first of the
many iterations it's going to take to appropriately tune my ailing
application, I had to be sure that the premises we're operating under
were sound.

Hopefully, the ubiquitous "they" will be get around to changing the
1.3.1 graphic accordingly.  Sure, 1.4.2's new & improved - but there
are probably a lot of shops out there that do what my own does: wait
for the rest of the world to flush out all the problems.

(Moazam, it's good to see you in the NG's.  Thanks, for taking the
time to respond.) -TF

>(sorry for the long winded response, but I think it's needed as this is
>indeed a very confusing topic)
[quoted text clipped - 70 lines]
>>
>> -- Tony
Moazam Raja - 06 Mar 2004 23:45 GMT
> Thanks for the clarification, Moazam.  (Your name looks/sounds very
> familiar to me...unixville = _ _ _, methinks).

Heh, no problem Tony. I've been moazam@unixville.com much longer than
I've been @sun.com though. :) Your question is very valid so I figured
people on this newsgroup should get an answer also. Too many times we
all just look at an article or document and take it as gospel. It's good
to question it, try it in real life, and get a proven answer for yourself.

> Hopefully, the ubiquitous "they" will be get around to changing the
> 1.3.1 graphic accordingly.

I'm going to try to find the original author of that image and talk to
them about it. If not, I'll just end up talking to the group at Sun who
is responsible for external articles. The image is confusing to me also
and the more I look at it, the more confused I get. Either way though,
it definitely needs clarification.

-Moazam

>>(sorry for the long winded response, but I think it's needed as this is
>>indeed a very confusing topic)
[quoted text clipped - 70 lines]
>>>
>>>-- Tony


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.