Chuck I don't want to restart the "memory allocation wars", primarily because I'm not totally sure on my stance, but I'm pretty sure that PermGen is not part of Heap. I'm particularly basing this on what I'm currently seeing in the Memory tab of jconsole. It breaks up memory into Heap and Non-Heap sections. It further breaks those down into the following:
Heap: "PS Eden Space", "PS Survivor Space", and "PS Old Gen" Non-Head: "Code cache" and "PS Perm Gen" Now, when I click on the Heap section, it shows a Max very close to my -Xmx setting. It's hard to say if equal, since I specify in Mb and it reads in kbytes, but it does appear lower than I would expect. For example: a -Xmx768m ends up with a setting of 757,312 kbytes. The Non-Heap section max is always higher than my -XX:MaxPermSize setting and appears to be a total of the Code Cache size and the PS PermGen size. Since I'm not specifying a value for the Code Cache it is consistently 32,768 kbytes. For a MaxPermSize of 256M, I get a Max reading of 262,144 kbytes. That is exactly 256 * 1024, so you'd think that my Heap of 768m would generate a Max value of 786,432 kbytes, but you end up with a value smaller by 29,102 kbytes. I wonder where that went? I think I know. First, the Max when you click on Heap isn't accurate. If you add up the total of the 3 spaces, you get much closer to the -Xmx setting, but are still a little short. As I recall, the Survivor Space is really two spaces used alternately during GCs, and surprisingly the missing amount is almost exactly the same as the Survivor space number. However, I'm still stumped as to why the Max Heap reading is so much lower than the -Xmx setting you have you believe, or a manual totaling of the 3 segments shows it to be. Of course, it appears that the max readings for at least the Eden and Survivor spaces can change over time, so perhaps there is just reserved space in case those sections need to expand a little. In about an hour of monitoring, the Old Gen max size never budged. I will agree with your assertion that it all has to be allocated contiguously. Also, please note these are all numbers for a Java 5 implementation, though Java 6 (64-bit) shows the same patterns of allocation noted above. > -----Original Message----- > From: Caldarale, Charles R [mailto:chuck.caldar...@unisys.com] > Sent: Wednesday, September 29, 2010 12:14 PM > To: Tomcat Users List > Subject: RE: apache-tomcat-6.0.29 will not start with more then 1024mb > memory assigned - windows > > From: Jeffrey Janner [mailto:jeffrey.jan...@polydyne.com] > Subject: RE: apache-tomcat-6.0.29 will not start with more then 1024mb > memory assigned - windows > > > So there is some tradeoff between PermGen space and Heap. > > The NewGen, OldGen, and PermGen areas of the heap have to be allocated > in one contiguous chunk of process space in a HotSpot JVM. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE > PROPRIETARY MATERIAL and is thus for use only by the intended > recipient. If you received this in error, please contact the sender and > delete the e-mail and its attachments from all computers. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > __________________________________________________________________________ Confidentiality Notice: This Transmission (including any attachments) may contain information that is privileged, confidential, and exempt from disclosure under applicable law. If the reader of this message is not the intended recipient you are hereby notified that any dissemination, distribution, or copying of this communication is strictly prohibited. If you have received this transmission in error, please immediately reply to the sender or telephone (512) 343-9100 and delete this transmission from your system. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org