Right Way to Set JVM Heap Size

932 views
Skip to first unread message

Amit Dubey

unread,
Nov 14, 2011, 7:53:41 PM11/14/11
to play-framework
Hi,

This should be an easy question, but I'm scratching my head right now.
I'm using Play Framework 1.2.3 with Scala-0.9.1. My app is data-
intensive, and I'm running out of memory and have tried adding:

jvm.memory=-Xmx1500m -Xms512m

To conf/application.conf, but this has no effect.

I've also tried:

./play run <app> -Xmx1500m -Xms512m

But looking at jconsole, these options are *prepended* to the default -
Xmx512m -Xms512m. The JVM presumably ignores my first option.

In case you're superstitious, I've also tried swapping the -Xmx and -
Xms.

Also, this is not a memory leak, I have a genuine need for having that
much data in memory.

How do I unambiguously give the JVM more heap space?

Best,
-Amit

Manuel Bernhardt

unread,
Nov 15, 2011, 2:39:28 AM11/15/11
to play-fr...@googlegroups.com
Hi Amit,

yes, this is broken. See
https://play.lighthouseapp.com/projects/74274/tickets/44-jvmmemory-configuration-option-not-taken-into-account#ticket-44-2

A fix is here: https://github.com/playframework/play-scala/pull/20

And it's patiently waiting to be merged in ;-) We use a patched
version of the latest version from head in our environment.

Manuel

> --
> You received this message because you are subscribed to the Google Groups "play-framework" group.
> To post to this group, send email to play-fr...@googlegroups.com.
> To unsubscribe from this group, send email to play-framewor...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/play-framework?hl=en.
>
>

Amit Dubey

unread,
Nov 15, 2011, 5:11:31 AM11/15/11
to play-fr...@googlegroups.com
Thanks Manuel, I will try your fix.

Best,
-Amit
Reply all
Reply to author
Forward
0 new messages