wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Heap Space setup in RHEL 6 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Heap Space setup in RHEL 6" Watch "Heap Space setup in RHEL 6" New topic
Author

Heap Space setup in RHEL 6

Khalid Mahamud
Greenhorn

Joined: Mar 08, 2013
Posts: 1
I am using tomcat server in a RHEL 6 sever with 16GB RAM.

But I don't know how to setup heap space in JAVA_OPTS in Linux.

I also need to what should the maximum size of my server.

I am using BIRT report. When multiple user want run same report or multiple report concurrently then report server are not responding. why this happening. I think maximum report highly big sql related. and time required.

please give me advice ASAP.

For your kind information I am very Beginner in this field.

K. Gil
Ranch Hand

Joined: Apr 29, 2011
Posts: 75

just add extra line at the top of your "bin/catalina.sh" file:
export JAVA_OPTS="-Xms12G -Xmx12G"


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16160
    
  21

K. Gil wrote:just add extra line at the top of your "bin/catalina.sh" file:
export JAVA_OPTS="-Xms12G -Xmx12G"




Please don't. It isn't necessary, and if at all possible one should avoid modifying standard scripts. It makes them behave in unexpected ways, can possibly introduce problems in starting/stopping/controlling the service, and can be a royal nuisance when it's time to upgrade.

Tomcat has a place for stuff like this. Just create a file named "setenv.sh" (or setenv.sh, for Windows) and place the following line in it:



The setenv file goes in the TOMCAT_HOME/bin directory, just line the statup.sh and catalina.sh files do.

Note that if you really need to give Tomcat such a huge amount of RAM that you absolutely positively MUST be running the 64-bit JVM. The 32-bit JVM can't even begin to work with a heap that big.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Heap Space setup in RHEL 6