Memory on heroku

on new JRuby apps heroku starts with -Xmx384m. I’ve found that this
setting
always results in R14 (out of memory) errors. I’ve stepped it down bit
by
bit and now am on 256 which I think will work.

Here’s my memory use for the last 24 hours http://note.io/1d6kWbN

Note that physical memory use sometimes jumps way up and stays there.

  1. Am I correct in thinking that this doesn’t have to do with my app’s
    behavior and all JVM/JRuby instances will use almost the same physical
    memory given the same config?
  2. Why does physical ram usage change so dramatically?
  3. Does my memory usage generally look normal?
  4. Does anyone else have anecdotal info to share on what memory settings
    work?

my JAVA_OPTS:

-Xms256m -Xmx256m -Xss512k -XX:+UseCompressedOops
-javaagent:vendor/newrelic/newrelic.jar

Thanks,
John