• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Right syntax for JVM tuning on tomcat server and redhat linux machine

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My application had some problem with JVM tuning. I found out the problem where i should increase me XmX value (Which I had done successfully on my windows machine through eclipse). But, my goal is to successfully run the application on a redhat linux machine. I found out that the changes are to be made to the JAVA_OPTS section in catalina.sh file. But, i am confused with the syntax.
The JAVA_OPTS is already provided in the catalina.sh file as :

# Set juli LogManager if it is present
if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:MaxPermSize=1024m"



How do I change this so as to incorporate my requirement (Xms64m and Xmx512m).

Thanks a lot in advance..!
 
Sheriff
Posts: 22563
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Edit the file with a text editor, and simply add these two inside the quotes on the last line.
 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:Edit the file with a text editor, and simply add these two inside the quotes on the last line.



I dint get U..!
 
Rob Spoor
Sheriff
Posts: 22563
122
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Which of the two didn't you understand? Opening the file, or adding these two flags, exactly like you've given them, inside the quotes ("") on the last line (JAVA_OPTS=...)?
 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Prime wrote:Which of the two didn't you understand? Opening the file, or adding these two flags, exactly like you've given them, inside the quotes ("") on the last line (JAVA_OPTS=...)?



Fine..! I made the changes to the tomcat in my Linux server and it looks like how it's given below.

# Set juli LogManager if it is present
if [ -r "$CATALINA_HOME"/bin/tomcat-juli.jar ]; then
JAVA_OPTS="$JAVA_OPTS -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -XX:MaxPermSize=1024m -Xms64m -Xmx512m".

Is there any else we can do to fine tune jvm? I am still getting a heap error. In my client developer machine which runs on windows 7 i increased Xms to 64m and Xmx to 512m and it works fine. Is there anything else to be done to tomcat installed on redhat Linux? (My server uses redhat linux)
 
Ranch Hand
Posts: 959
Eclipse IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Before you fine tune the JVM settings. You better profile your application first and see whether there is memory leakage or something of that sort. Fine tuning the JVM without doing any profiling is quite a premature solution.
 
Nitin Menon
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Freddy Wong wrote:Before you fine tune the JVM settings. You better profile your application first and see whether there is memory leakage or something of that sort. Fine tuning the JVM without doing any profiling is quite a premature solution.



I've done all the memory leakage checking and have run it successfully on windows machines where, I set the JAVA_OPTS -Xmx parameter which was 128 to 512.
But the problem is in the Linux server machine. I tried increasing XX:MaxPermSize from 512 to 1024. There was no parameter for Xmx and Xms. I added them with the above mentioned string and set Xmx to 512 and Xms to 64.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic