Improving Tomcat memory parameters

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

···

---------- Forwarded message ----------
From: James Arbaugh jarbaugh@hashaiti.org

Date: Sun, Apr 14, 2013 at 10:25 PM
Subject: RE: Improving Tomcat memory parameters
To: implementers@openmrs.org

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@openmrs.org [mailto:implementers@openmrs.org] On Behalf Of Ellen Ball

Sent: Thursday, April 11, 2013 5:33 PM
To: implementers@openmrs.org
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@openmrs.org
Unsubscribe: implementers+unsubscribe@openmrs.org

Manage your OpenMRS subscriptions at https://id.openmrs.org/

OpenMRS Implementers: http://go.openmrs.org/implementers

Post: implementers@openmrs.org

Unsubscribe: implementers+unsubscribe@openmrs.org

Manage your OpenMRS subscriptions at https://id.openmrs.org/


Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org

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@gmail.com wrote:

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

---------- Forwarded message ----------
From: James Arbaugh jarbaugh@hashaiti.org

Date: Sun, Apr 14, 2013 at 10:25 PM
Subject: RE: Improving Tomcat memory parameters
To: implementers@openmrs.org

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@openmrs.org [mailto:implementers@openmrs.org] On Behalf Of Ellen Ball

Sent: Thursday, April 11, 2013 5:33 PM
To: implementers@openmrs.org
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@openmrs.org
Unsubscribe: implementers+unsubscribe@openmrs.org

Manage your OpenMRS subscriptions at https://id.openmrs.org/

OpenMRS Implementers: http://go.openmrs.org/implementers

Post: implementers@openmrs.org

Unsubscribe: implementers+unsubscribe@openmrs.org

Manage your OpenMRS subscriptions at https://id.openmrs.org/

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org


Mailing list: https://launchpad.net/~dhis2-users

Post to : dhis2-users@lists.launchpad.net

Unsubscribe : https://launchpad.net/~dhis2-users

More help : https://help.launchpad.net/ListHelp

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.html

Regards,

Paulo Grácio
Technical Manager
(+258) 822 544 603

Critical Software Mozambique
Dependable Technologies for Critical Systems

Critical Software Mozambique is a subsidiary of Critical Software, a CMMI® Level 5 rated Company
CMMI® is registered in the USPTO by 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@lists.launchpad.net] On Behalf Of Orvalho Augusto
Sent: segunda-feira, 15 de Abril de 2013 09:48
To: Knut Staring
Cc: dhis2-users@lists.launchpad.net
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@gmail.com wrote:

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

---------- Forwarded message ----------
From: James Arbaugh jarbaugh@hashaiti.org
Date: Sun, Apr 14, 2013 at 10:25 PM
Subject: RE: Improving Tomcat memory parameters
To: implementers@openmrs.org

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@openmrs.org [mailto:implementers@openmrs.org] On Behalf Of Ellen Ball
Sent: Thursday, April 11, 2013 5:33 PM
To: implementers@openmrs.org
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@openmrs.org
Unsubscribe: implementers+unsubscribe@openmrs.org
Manage your OpenMRS subscriptions at https://id.openmrs.org/


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

Knut Staring

Dept. of Informatics, University of Oslo

+4791880522

http://dhis2.org


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