-XX:+AggressiveHeap usage for JVM? This email is pointed almost directly for Carl Oliver, since he seems to be someone who knows his virtual memory settings, but I figure Joe Reger might get something out of it too ;)
Evidently this setting by iteself "instructs the JVM to push memory use to the limit", and is only recommended for use on boxes containing a single JVM with nothing else running on it (a server running only Tomcat seems to foot the bill) It does a few things that Carl suggested implicitly -XX:+UseParallelGC -XX:+UseAdaptiveSizePolicy -Xss256k You can read more about it here: http://java.sun.com/docs/hotspot/gc1.4.2/ >From my experience it has made some of our "problem servers" much more stable, allowing them to run for months without OOM instead of days or weeks allowing us to actually use session replication without the servers going bananas ;) We also used to have our Max memory set at -Xms1300mb and -Xmx1300mb, but I have found that when using the -XX+Aggressive heap the JVM memory usage rarely tops 1024MB because it's cleaned out much more efficiently. Carl what is your take on this? I realize it uses a bit more CPU because of the adaptive size and parallelGC, but on duel Xeon boxes CPU usually isn't the limiting factor (at least in our case). What gains/loss do you see over using -XX:AggressiveHeap (dynamic, adjustible settings) vs hard coding fixed settings like you suggest? -rOcK -----Original Message----- From: Carl Olivier [mailto:[EMAIL PROTECTED] Sent: Saturday, December 03, 2005 7:43 AM To: 'Tomcat Users List'; [EMAIL PROTECTED] Subject: RE: How much memory will Tomcat 5.5/Java 5 support? Hi Joe. Well, heres how I run it - and remember this is all dependent on the beakdown of requirements of the following: 1. Web app memory needs - how memory intensive are your web apps within Tomcat going to be? 2. Concurrent connections (tcp threads) for incoming requests - how busy will the web apps be? 3. Are you running DB connections? Are you using a Connection pool? How long will each db connection take to return? 4. Are you running OTHER applications/servers on the server which will require memory? E.g. RDBMS Server 5. Always be aware that the native OS will also need memory - thus you cannot just give it all to Tomcat! So, heres one of my scenarios: Server: Quad Xeon 2GB RAM OS: Windows 2000 Server (32 bit) Applications/Servers: Tomcat 5.0.28 (with 40 web apps/contexts/classloaders) MSSQL Server 2000 My Tomcat runtime switches are as follows: -Xms768m //assign all the JVM heap at startup to 768mb -Xmx768m //assign max JVM heap -Xss128k //set the native thread stack size memory allocation down from windows def of 1024kb - very useful -XX:+UseParallelGC //parralel GC - makes use of the multiple processors -XX:MaxPermSize=256m //up the perm gen space (used for classloading etc) from def 64mb - also useful with lots of web apps -XX:+DisableExplicitGC //don't let the System.gc() be called as it could cuse 'pause the world's I also limit the amount of RAM that MSSQL can have to 640mb - and have also set the memory allocation size per sql connection down from 1024kb to 512kb (SQL Server setting) - this is however due to my running MSSQL Server on the same box and may not apply. I have thus left some RAM for the OS to use where required - this should not be ignored. I found that this is a pretty stable setup - with my only problem occurring occasionally when I get a MAJOR spike in concurrent requests. I plan to upgrade to a 64bit OS soon and to up the SQL RAM allocation as my problem lies there - it sometimes has issues with memory! It should be noted that my web apps can be fairly SQL intensive - I do have VM level caching but alas not all of it.... Anyway - I do hope that helps! Other areas you could look into is the number of concurrent requests Tomcat serves (set at a Connector level) - as too many will cause memory issues under load, while too few will cause visitors to be rejected/wait for response! Anyway, take care, Carl -----Original Message----- From: Joe Reger, Jr. [mailto:[EMAIL PROTECTED] Sent: 03 December 2005 13:19 To: Tomcat Users List Subject: Re: How much memory will Tomcat 5.5/Java 5 support? > Are you running a 64bit or 32bit OS? If 32bit the JVM will not be > able to assign higher that 2gb for a single process (which includes > system overheads etc). Hi Carl - I'm 32 bit right now. I'll check the archive for past posts. How would you go about using more of the memory that I have on the server? Can I run two Tomcat services and cluster? Thanks for the feedback and help! Joe --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]