Search code examples
grailscloud-foundrypermgenvmc

Memory limit of 512M exceeded


I am trying to run a Grails app at cloudfoundry.com, but it is returning a 502 Bad Gateway and then a 404 Not Found. I located logs/err.log, and it says:

# Logfile created on 2012-11-22 17:39:55 +0000 by logger.rb/25413
F, [2012-11-22T17:39:55.488036 #10723] FATAL -- : Memory limit of 512M exceeded.
F, [2012-11-22T17:39:55.488101 #10723] FATAL -- : Actual usage was 516M, process terminated.

Prior to this, I was getting PermGen space errors, so I added this to the environment:

+-----------+----------------------------------------+
| Variable  | Value                                  |
+-----------+----------------------------------------+
| JAVA_OPTS | -XX:MaxPermSize=512m -Xms512M -Xmx512M |
+-----------+----------------------------------------+

What options do I have? Can I make any tweaks to try to fit my app into 512M? If I reduce MaxPermSize, would that give my app more space? Is there any way to determine exactly what size Perm space is needed?

Or have I simply outgrown CloudFoundry? Is there any way (including by paying) to get a bigger VM at CloudFoundry? Or do I have to move to a different service entirely?


Solution

  • You just need to change the amount of resource assigned to the application. You can do this with VMC, for example, to change the memory allocation for an application called my app to 1GB;

    vmc mem myapp 1G
    

    Keep in mind that your account had a maximum of 2G for all your applications.