Not sure if this is officially sanctioned by VMware or not, but it's a standard tomcat6 option....
Having just installed a new datacenter, consisting of 2 ESX4 hosts, one template, and one VM, tomcat6.exe was consuming roughly 1.2GB memory after 48hrs running.
From http://tomcat.apache.org/tomcat-6.0-doc/windows-service-howto.html I simply added "--JvmMx=512" to the end of 'ImagePath' of the service in the registry:
and restarted the service
Considering it's a standard tomcat option, I can't see why it shouldn't be supported. Will keep an eye on things.
i don`t really like an attitude like this, i.e. "just throw ram at a software memory hog without knowing, if it REALLY needs it".
I have seen my tomcat on vsphere server also go up to >>1gb.
as i know that java programmers often are careless people when it comes to ram requirements of their app, i think there maybe room for optimization.
i have worked in support team for an enterprise java based web-app, and whenever there was a memory issue and i talked to the programmers it always wasn`t their fault but the machine not being equipped with enough ram (which was nonsense in more than 90% of all support cases)
java programmers really don`t know how to do memory efficient programming. they leave it up to the garbage collector.
harsh words, i know - but prove the contrary
oh - and btw - besides the web-interface - what services does the tomcat6 instance provide exactly?
is there an architectural vcenter server overview for this?
Have you experienced any issues since you have limited TomCat to 512MB of RAM? I am having the same issues as you state but do not want to cause any other issues.
I would like to know if there are some issues with limiting tomcat as well. It makes SQL look like a light weight.
i`d add -Xloggc:path\to\logfile to the tomcat startup and have a look on that with a gc log analyzing tool.
if you see large time being spent with garbage collection (whenever this happens your jvm will stall) tomcat has memory issues.
if not, all should be well.
Well, so far no noticable issues
but that said, this particular environment is relatively small - 2 hosts and 10 VM's. Regular operations are fine, but I don't think they reference the webservices. Update Manager runs fine. No other plugins in use. The tomcat6.exe is consuming 5-600MB which seems more appropriate.
Haven't used the log parameter yet, but do agree that it's probably a good idea.
I do not want to throw in extra memory just for a (terrible) management web interface. I solved the mayhem by switching to Virtualbox.
Update: as per http://deinoscloud.wordpress.com/2009/11/30/tomcat-for-vcenter-memory-tuning/ a couple of Jvm memory parameters are pre-set for the vcenter tomcat6 instance.
Removing the fixed-allocation settings in the registry seems to have the desired affect of keeping the tomcat6 memory usage to a more "normal" amount
Locate the following registry key, for either x64 or x86 systems
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\vctomcat\Parameters\Java
HKEY_LOCAL_MACHINE\SOFTWARE\Apache Software Foundation\Procrun 2.0\vctomcat\Parameters\Java
And set each value to 0x0 and restart the vCenter Webservices service
JvmMs = 0x0
JvmMx = 0x0
JvmSs = 0x0
Note: I also removed the "--JvmMx=512" from the service configuration mentioned previously, and memory usage is maintained around the 220MB mark.
Been following this post, the --JvmMx=512 didn't work but this gem did! Holding steady at 168MB (working set) and 205MB (VM Size).
Note: I'm only doing this in a lab env.
Guys, that Reg key listed first is not the place to tweak them. I just adjusted mine -
On windows, the memory should be set in the
hkey local machine\software\apache software foundation\procrun 2.0\tomcat\parameters\java
Then there is a JvmMs and JvmMx and JvmSs
I tweaked Mx and Ss down to 512 - from 1024 and have had much better luck
These settings worked for me. Thanks for the post. Tomcat6.exe memory utilization went from 1300MB to 350MB.