VMware Cloud Community
chimoe125
Contributor
Contributor

vServer - tomcat6 memory usage HIGH

I have installed vSphere vServer on a virtual machine with 2GB RAM and I am noticing that Guest Memory is at 99%. According to taskmanager, tomcat6.exe is using 729MB RAM. Anyone know how I can fix this?

Reply
0 Kudos
19 Replies
dcoz
Hot Shot
Hot Shot

chimoe125,

Eric Siebert wrote a good article on this.

See link http://itknowledgeexchange.techtarget.com/virtualization-pro/memory-usage-in-vcenter-server-40/

Regards

DC

Reply
0 Kudos
colin_macd
Contributor
Contributor

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 I simply added "--JvmMx=512" to the end of 'ImagePath' of the service in the registry:

HKLM\SYSTEM\CurrentControlSet\Services\vctomcat

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.

-Colin

Reply
0 Kudos
AntonVZhbankov
Immortal
Immortal

Nothing to fix with tomcat6, it actually requires a lot of memory. So just add memory to machine.


---

VMware vExpert '2009

http://blog.vadmin.ru

EMCCAe, HPE ASE, MCITP: SA+VA, VCP 3/4/5, VMware vExpert XO (14 stars)
VMUG Russia Leader
http://t.me/beerpanda
Reply
0 Kudos
devzero
Expert
Expert

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

Smiley Wink

Reply
0 Kudos
devzero
Expert
Expert

oh - and btw - besides the web-interface - what services does the tomcat6 instance provide exactly?

is there an architectural vcenter server overview for this?

Reply
0 Kudos
petethree
Contributor
Contributor

Hi Colin,

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.

Thank you,

-Pete

Reply
0 Kudos
Osm3um
Enthusiast
Enthusiast

I would like to know if there are some issues with limiting tomcat as well. It makes SQL look like a light weight.

Bob

Reply
0 Kudos
devzero
Expert
Expert

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.

Reply
0 Kudos
colin_macd
Contributor
Contributor

Well, so far no noticable issues Smiley Wink

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.

Reply
0 Kudos
ooswald
Contributor
Contributor

I do not want to throw in extra memory just for a (terrible) management web interface. I solved the mayhem by switching to Virtualbox.

Reply
0 Kudos
colin_macd
Contributor
Contributor

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.

Reply
0 Kudos
BenConrad
Expert
Expert

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.

Ben

Reply
0 Kudos
John_Bergin
Contributor
Contributor

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

Reply
0 Kudos
vmaier
Contributor
Contributor

These settings worked for me. Thanks for the post. Tomcat6.exe memory utilization went from 1300MB to 350MB.

Reply
0 Kudos
ylevadoux
Contributor
Contributor

Hello,

On my vCenter server, tomcat6.exe was using 1300 Mb of memory, and I adjust the registry setting located in

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\Procrun 2.0\vctomcat\Parameters\J... to :

JvmMs = 0x0

JvmMx = 0x0

JvmSs = 0x0

Then restart web service;

tomcat6.exe now use 225 Mb

Thank you !

Yannick

Reply
0 Kudos
jcwuerfl
Hot Shot
Hot Shot

If your not using the VMware Web Service, I would just stop and disable that service.

Reply
0 Kudos
ylevadoux
Contributor
Contributor

Thanks for tip, but I still need the web access service, but it was (only !) using too much memory from my point of view and vCenter was unstable.

Now it is better.

Reply
0 Kudos
rickardnobel
Champion
Champion

If your not using the VMware Web Service, I would just stop and disable that service.

I think the Webservice is used for some other stuff too, as some of the Performance charts and some search handling, which does not seems to have any connection to the webservice.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
chrisnet46
Contributor
Contributor

After settings JvmMs = 0x0, JvmMx = 0x0, JvmSs = 0x0, the search inventory function in VSphere client doesn't work anymore.

I don't know if there are any other side effects.

Reply
0 Kudos