Loading...

users@tomcat.apache.org

[Prev] Thread [Next]  |  [Prev] Date [Next]

RE: Free Memory vs. Total Memory vs. Max Memory Robinson, Eric Fri Feb 17 21:00:24 2012

> >> I can see the lure of "only taking what you need" and allowing the 
> >> JVM to automatically re-size the memory space:
> >> that way, you only take up a huge chunk of memory during peak load 
> >> and not all the time.
> >>
> >> But why?
> >>
> >> If you are going to need, say, 512MiB at peak load, you're 
> going to 
> >> need that memory available whether or not it is allocated 
> to the JVM 
> >> itself at any given time. If that's the case, why not let the JVM 
> >> have that memory all the time?
> > 
> > 
> > Because the server has about 100 instances of tomcat. They 
> do not all 
> > need the memory at the same time.
> > 
> 
> Famous last words..
> 
> But if they ever do, you are going to experience random 
> failures of your Tomcat instances, or at the very least a 
> dramatic drop in performance, when this starts to swap to disk.
> 
> We don't know what your precise circumstances are, and maybe 
> your case is special.
> But in general, I would not recommend this as a way to run a 
> production server.
> 
> Technically, you can do what you described.  What results it 
> will have in the practice, you will find out.
> 

Okay, full disclosure time.

We have many servers that have been running 100-200 instances of tomcat
each for years without any performance problems. Most of our servers are
Linux 8-core machines with 32GB RAM, with the tomcat instances
configured with -Xms16M -Xmx192M. We also have some Windows servers with
100-150 instances of tomcat each, most of which are configured with
-Xms16M -Xmx64M. 

Recently, we had someone tell us that a particular thread of one
particular Windows tomcat instance was freezing up due  to lack of
memory. They insisted that we set that instance to -Xms512M -Xmx512M. I
felt that they were wrong because there were no OOM or GC messages in
the logs, but I wanted to make them happy, so I set it to -Xms16M
-Xmx512M because I felt that this would give them the max memory they
were requesting while also ensuring that the instance did not use more
memory than it really needed. It seemed like a win-win. However, they
were not happy. They insisted that we set the minimum to 512M as well. I
did it but I am annoyed. I don't think my approach is dangerous at all
becaise the time involved in allocating memory and doing GC does not
have a significant impact on performance. My plan was to come onto the
tomcat list and see if I could drum up support for my thoughts, but I
realize that I also risk being told that I'm wrong. :-)

--Eric


Disclaimer - February 17, 2012 
This email and any files transmitted with it are confidential and intended 
solely for Tomcat Users List. If you are not the named addressee you should not 
disseminate, distribute, copy or alter this email. Any views or opinions 
presented in this email are solely those of the author and might not represent 
those of Physicians' Managed Care or Physician Select Management. Warning: 
Although Physicians' Managed Care or Physician Select Management has taken 
reasonable precautions to ensure no viruses are present in this email, the 
company cannot accept responsibility for any loss or damage arising from the 
use of this email or attachments. 
This disclaimer was added by Policy Patrol: http://www.policypatrol.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]