Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 709369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T04:29:48+00:00 2026-05-14T04:29:48+00:00

Tomcat 5.5.x and 6.0.x Grails 1.6.x Java 1.6.x OS CentOS 5.x (64bit) VPS Server

  • 0

Tomcat 5.5.x and 6.0.x

Grails 1.6.x

Java 1.6.x

OS CentOS 5.x (64bit)

VPS Server with memory as 384M

JAVA_OPTS : tried many combinations- including the following

export JAVA_OPTS=’-Xms128M -Xmx512M -XX:MaxPermSize=1024m’

export JAVA_OPTS=’-server -Xms128M -Xmx128M -XX:MaxPermSize=256M’

(As advised by http://www.grails.org/Deployment)

I have created a blank Grails application i.e simply by giving the command grails create-app and then WARed it

I am running Tomcat on a VPS Server

When I simply start the Tomcat server, with no apps deployed, the free memory is about 236M
and used memory is about 156M

When I deploy my “blank” application, the memory consumption spikes to 360M and finally the Tomcat instance is killed as soon as it takes up all free memory

As you have seen, my app is as light as it can be.

Not sure why the memory consumption is as high it is.

I am actually troubleshooting a real application, but have narrowed down to this scenario which is easier to share and explain.

UPDATE
I tested the same “blank” application on my local Tomcat 5.5.x on Windows and it worked fine

The memory consumption of the Java process shot from 32 M to 107M. But it did not crash and it remained under acceptable limits

So the hunt for answer continues… I wonder if something is wrong about my Linux box. Not sure what though…

UPDATE 2
Also see this http://www.grails.org/Grails+Test+On+Virtual+Server

It confirms my belief that my simple-blank app should work on my configuration.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T04:29:48+00:00Added an answer on May 14, 2026 at 4:29 am

    It is a false economy to try to run a long running Java-based application in the minimal possible memory. The garbage collector, and hence the application will run much more efficiently if it has plenty of regular heap memory. Give an application too little heap and it will spend too much time garbage collecting.

    (This may seem a bit counter-intuitive, but trust me: the effect is predictable in theory and observable in practice.)

    EDIT

    In practical terms, I’d suggest the following approach:

    1. Start by running Tomcat + Grails with as much memory as you can possibly give it so that you have something that runs. (Set the permgen size to the default … unless you have clear evidence that Tomcat + Grails are exhausting permgen.)

    2. Run the app for a bit to get it to a steady state and figure out what its average working set is. You should be able to figure that out from a memory profiler, or by examining the GC logging.

    3. Then set the Java heap size to be (say) twice the measured working set size or more. (This is the point I was trying to make above.)

    Actually, there is another possible cause for your problems. Even though you are telling Java to use heaps of a given size, it may be that it is unable to do this. When the JVM requests memory from the OS, there are a couple of situations where the OS will refuse.

    • If the machine (real or virtual) that you are running the OS does not have any more unallocated “real” memory, and the OS’s swap space is fully allocated, it will have to refuse requests for more memory.

    • It is also possible (though unlikely) that per-process memory limits are in force. That would cause the OS to refuse requests beyond that limit.

    Finally, note that Java uses more virtual memory that can be accounted for by simply adding the stack, heap and permgen numbers together. There is the memory used by the executable + DLLs, memory used for I/O buffers, and possibly other stuff.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have to deploy a Grails application on a Tomcat server. So I packaged
Being an (extreme) newbie to grails/groovy/maven/tomcat etc, I endeavoured to set up a CentOS
What tool would you recommend for continuous integration in a Grails + Tomcat (+
Tomcat (version 5 here) stores session information in memory. When clustering this information is
after updating my grails app's security plugins, i get the following error when deploying
I'm currently deploying to a VPS where I'm using Tomcat 7 and I'm seeing
has anybody worked with a Grails application in production in Jetty and Tomcat and
Grails 1.3.6 Tomcat6 I created a production ROOT.war. Deleted the default tomcat ROOT directory.
I am deploying a WAR into a Tomcat 6 or Tomcat 7 server on
I'm getting the following exception thrown in my Grails application: [1564928] store.DiskStore ClassNameCache: Could

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.