title: Scala app exceeds Heroku memory quota
body: <p>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 <strong>R14 (Memory quota exceeded)</strong> 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.</p>
  <p>Those are the relevant environment variables on my Heroku instance:</p>
  <blockquote>
  <p>JAVA_OPTS:             -Xmx384m -Xss512k -XX:+UseCompressedOops -javaagent:newrelic/newrelic.jar</p>
  <p>JAVA_TOOL_OPTIONS:     -Djava.net.preferIPv4Stack=true</p>
  <p>SBT_OPTS: -Xmx384m -Xss512k -XX:+UseCompressedOops</p>
  <p>REPO: /app/.sbt_home/.ivy2/cache</p>
  </blockquote>
  <p>The web service is not even receiving any traffic yet, so why could Heroku be complaining about memory consumption?</p>
  <p>Marco</p>