JNLP MacOS OutOfMemoryError

In my JNLP, I set max-heap-size="1024m", but MacOS users very frequently have OutOfMemoryErrors.

<resources>
    <j2se version="1.6+" initial-heap-size="128m" max-heap-size="1024m" java-vm-args="-client -da"/>
    <jar href="IslandForge.jar" main="true"/>
</resources>
  • Is this a known/common problem?
  • Does MacOS simply need more RAM to run applications?
  • Does the “Apple Inc.” JVM not honor the max-heap setting?

I know there are many MacOS users here. Any insight into how to improve launching my game is greatly appreciated.

More info: It seems that Mac users tend to have 128MB RAM allocated, instead of the 1024MB specified in the JNLP. However, I have not been able to interview many to determine if they were running the raw JAR file (by downloading and double-clicking, without any command-line heap flag) or if they actually used the JNLP.

JNLP question: Should I just be providing the JNLP file, and not even offering the JAR file? In the past, this caused confusion when I updated the JNLP, but folks still had an old locally saved version. It looks like this might have been improved in late Java 1.6 (I’m not requiring 7 yet), but I don’t have enough evidence to know if it works well in practice.

Can anyone enlighten me on good JNLP deployment practice?

For OS X stand-alone, you should consider bundling your game in a .app, for a more “native” deployment there. The user can still double click on your game, and it’ll allow you to specify your heap settings and whatever else you want. There are discussions on how to bundle your app like this for Mac on this form, I believe.

BoBear2681 - thanks for the advice. That’s exactly what I’d like to do. I researched it a bit. The big hangup was how to include the necessary (and correct) JavaApplicationStub. It seems wrong to just download a binary file from someone else and include it. Why doesn’t Apple provide an “official” copy to include? How do I maintain and support this over different MacOS versions? These are just a couple of the hurdles I have not yet overcome in creating a proper Mac .app bundle.

Clearly I’m not Mac-savvy, but I think it’s a great platform, and I want to learn more. I’ll do more research here at JGO.

Here’s the primary external resource I’ve found:

http://developer.apple.com/library/mac/#documentation/Java/Conceptual/Java14Development/03-JavaDeployment/JavaDeployment.html

Hi

Is there a solution to force Mac OS X to honor the setting “max-heap-size” when using Java Web Start? Bundling my game as a .app is not an option. Maybe Mac OS X simply does not honor this property when it can’t be supported by the hardware without swapping instead of crashing.