File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Heap Space setup in RHEL 6" Watch "Heap Space setup in RHEL 6" New topic

Heap Space setup in RHEL 6

Khalid Mahamud

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/" file:
export JAVA_OPTS="-Xms12G -Xmx12G"

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17423

K. Gil wrote:just add extra line at the top of your "bin/" 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 "" (or, for Windows) and place the following line in it:

The setenv file goes in the TOMCAT_HOME/bin directory, just line the and 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.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Heap Space setup in RHEL 6
It's not a secret anymore!