← Back to team overview

dhis2-users team mailing list archive

Re: Fwd: Improving Tomcat memory parameters

 

Hi,

 

“We've experienced the pain of tomcat crashing on an OpenMRS 1.9.3
production server with this memory error:  "Java.lang.OutOfMemoryError:
PermGen"

·         The server has 32GB of RAM.  

·         tomcat is  using JAVA_OPTS = "-Xmx512m -Xms512m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:NewSize=128m"”

 

The JVM has a lot of optimization and intelligence for dynamic memory
allocation, so doing things like making -Xms equal to -Xmx or-XX:PermSize
equal to -XX:MaxPermSize  will remove some of the optimizations the JVM can
apply to its allocation strategies and therefor reduce your application
performance instead of improving it.

 

Note that these parameters always depend on your application. So the best
way is to monitor memory consumption of your app to perform some tuning.
Jconsole can be your best friend.

 
<http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.h
tml>
http://docs.oracle.com/javase/6/docs/technotes/guides/management/jconsole.ht
ml

 

Regards,

 <mailto:*%20your-email%20*> Paulo Grácio
Technical Manager
(+258) 822 544 603 

 <http://www.criticalsoftware.co.uk> Critical Software Mozambique
Dependable Technologies for Critical Systems

Critical Software Mozambique is a subsidiary of  <http://cmmiinstitute.com/>
Critical Software, a CMMI® Level 5 rated Company
CMMI® is registered in the USPTO by  <http://www.cmu.edu/> CMU

Rua Pereira Marinho, 179
Bairro de Sommerchield
Maputo
Moçambique
Phone: (+258) 214 951 45
Fax: (+258) 214 951 46

DISCLAIMER: This message is confidential and may contain privileged
information. It is for use only by the people or entities to whom it is
addressed. If you are not an intended recipient, you should not disclose,
distribute, copy, print, rely on or otherwise make use of this message. If
an addressing or transmission error has misdirected it to you we would be
grateful if you would please notify the sender by return, before deleting it
from your system.

 

 

 

From: Dhis2-users
[mailto:dhis2-users-bounces+pgracio=criticalsoftware.com@xxxxxxxxxxxxxxxxxxx
] On Behalf Of Orvalho Augusto
Sent: segunda-feira, 15 de Abril de 2013 09:48
To: Knut Staring
Cc: dhis2-users@xxxxxxxxxxxxxxxxxxx
Subject: Re: [Dhis2-users] Fwd: Improving Tomcat memory parameters

 

Great!!!

Needless to say on a 64bit machine. And are you usinge an enterprise kernel
(from Red Hat Enterprise or CentOS one)?

Thank you

Caveman

 

On Mon, Apr 15, 2013 at 9:38 AM, Knut Staring <knutst@xxxxxxxxx> wrote:

This discussion can be of interest to DHIS2 administrators as well.

---------- Forwarded message ----------
From: James Arbaugh <jarbaugh@xxxxxxxxxxxx>
Date: Sun, Apr 14, 2013 at 10:25 PM
Subject: RE: Improving Tomcat memory parameters
To: implementers@xxxxxxxxxxx



Hi Ellen,

 

We ran into those painful problems in the past too.  One thing we did was
added a crontab job to restart tomcat automatically during the night twice a
week as “preventative” maintenance.

 

FYI: our production server (with 46GB physical memory) runs stable with the
following tomcat configuration…

CATALINA_OPTS="-Xms10240m -XX:PermSize=6144m -XX:MaxPermSize=6144m
-XX:NewSize=4096m"

 

Thanks,

James

 

From: implementers@xxxxxxxxxxx [mailto:implementers@xxxxxxxxxxx] On Behalf
Of Ellen Ball
Sent: Thursday, April 11, 2013 5:33 PM
To: implementers@xxxxxxxxxxx
Subject: Improving Tomcat memory parameters
Importance: Low

 

We've experienced the pain of tomcat crashing on an OpenMRS 1.9.3 production
server with this memory error:  "Java.lang.OutOfMemoryError:  PermGen"

*	The server has 32GB of RAM.  
*	tomcat is  using JAVA_OPTS = "-Xmx512m -Xms512m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:NewSize=128m"

Has anyone else seen this error?  Has anyone experimented with increased
memory parameter values?  It seems that the Xmx and Xms values should be the
same for a server ("In a server environment, you normally want Xms and Xmx
set to the same value to avoid heap thrashing.").  The heap space shouldn't
be too high, but if anyone know the optimal size that would be helpful.

 

Thanks,

 

Ellen Ball

Partners In Health

 

 

-- 
OpenMRS Implementers: http://go.openmrs.org/implementers
Post: implementers@xxxxxxxxxxx
Unsubscribe: implementers+unsubscribe@xxxxxxxxxxx
Manage your OpenMRS subscriptions at https://id.openmrs.org/
 
 

-- 
OpenMRS Implementers: http://go.openmrs.org/implementers
Post: implementers@xxxxxxxxxxx
Unsubscribe: implementers+unsubscribe@xxxxxxxxxxx
<mailto:implementers%2Bunsubscribe@xxxxxxxxxxx> 
Manage your OpenMRS subscriptions at https://id.openmrs.org/
 
 





 

-- 

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522 <tel:%2B4791880522> 

http://dhis2.org 


_______________________________________________
Mailing list: https://launchpad.net/~dhis2-users
Post to     : dhis2-users@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~dhis2-users
More help   : https://help.launchpad.net/ListHelp

 


References