turboDi
turboDi

Reputation: 137

Heroku memory quota exceeded with simple Grails app

I am trying to deploy very simple Grails 2.3.7 application (several REST controllers and Spring Security REST) on Heroku and constantly getting

Error R14 on Heroku (Memory Quota Exceeded)
Process running mem=906M(177.1%)

My BuildConfig.groovy contains:

grails.project.fork = [
    test: false,
    run: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    war: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256, forkReserve:false],
    console: [maxMemory: 768, minMemory: 64, debug: false, maxPerm: 256]
]

Why does Grails consume so much memory and how can i tune my BuildConfig.groovy to fit into 512mb Heroku limitation?

UPD May be the issue is in my travis.yml file? It looks like this:

language: groovy
jdk:
- oraclejdk7
before_script:
- chmod +x grailsw
script: ./grailsw clean
  && ./grailsw refresh-dependencies
  && ./grailsw test-app
before_deploy:
- chmod +x grailsw
deploy:
  provider: heroku
  app: igetit
  on: develop

Upvotes: 5

Views: 540

Answers (2)

Erik Pragt
Erik Pragt

Reputation: 14657

My comment as an answer:

If you use grails war, then these memory settings are not used. They are only used for forked execution, for example when running test-app or run-war. Your memory settings are probably controlled by your JAVA_OPTS. I'm not familiar with Heroku, but you could take a look here:

Heroku JVM tuning

Upvotes: 1

MKB
MKB

Reputation: 7619

When you don't mention jdk then heroku by default take open-jdk. Just mention the jdk version.

Create a file system.properties in parallel of application.properties and add the following line:

java.runtime.version=1.7

Commit this file and redeploy.

Ref# Grails R14 Error (Memory quota exceeded) on Heroku

Upvotes: 1

Related Questions