I am hosting the backend for my mobile application on Heroku. It's written in Scala using Scalatra to expose the REST API. In addition to that, I'm running a worker that fetches data and pushes it to the database at MongoHQ (using casbah). For both of them I keep getting R14 (Memory quota exceeded) errors. On my local machine, the worker is consuming not more than about 200 - 250 MB of memory and according to New Relic monitoring, the Scalatra app is utilizing only 250 MB on Heroku.
Those are the relevant environment variables on my Heroku instance:
JAVA_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:newrelic/newrelic.jar
JAVA_TOOL_OPTIONS: -Djava.net.preferIPv4Stack=true
SBT_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops
REPO: /app/.sbt_home/.ivy2/cache
The web service is not even receiving any traffic yet, so why could Heroku be complaining about memory consumption?
Marco