cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
cartouchbea
Level 2

Error running app on some Macs

I have a rather simple java application that is installed via InstallAnywhere that installs properly on all Macs. However some Mac have a problem when running the application. They get the following error in the console log:

[CODE]
11/18/09 3:47:28 PM [0x0-0x1c51c50].Application[16104] Error occurred during initialization of VM
11/18/09 3:47:28 PM [0x0-0x1c51c50].Application[16104] Too small initial heap for new size specified
11/18/09 3:47:28 PM com.apple.launchd[141] ([0x0-0x1c51c50].Application[16104]) Exited with exit code: 1
[/CODE]

When I look in the Info.plist file for the app I see the following snippet:


VMOptions

-Xms2M
-Xmx64M



So, I think I need to tweak this to make it larger but I'm not sure how I do that. Can anyone tell me where I can change these things in the project so that the generated application will run properly?

Thanks

cartouchbea
Labels (1)
0 Kudos
(2) Replies
pv7721
Level 20

Well, I'm not sure about Macs, but it is true that you can set the Minimum and Maximum heap size in the Advanced Designer, but for the installer only. But this is not your issue, right? Your issue is with the installed application. What you can do is to open your project, go to the Install task, go to the LaunchAnywhere that launches your application and edit its properties. Add the following property (if not already there): lax.nl.java.option.additional with the following value: -XmsM XmxM, where you would put bigger numbers for the minimal and maximal heap size.
0 Kudos
cartouchbea
Level 2

Thanks for your help pv7712.

I tried your suggestion and now the Info.plist file reads:


VMOptions

-Xms2M
-Xmx64M
-Xms32M
-Xmx512M



Looked awkward, but it did the trick.

Did a little further investigation and found that I really needed to define:

lax.nl.java.option.java.heap.size.initial = 16777216
lax.nl.java.option.java.heap.size.max = 50331648

to replace the default values of 2M and 64M.

Apparently you can not define those parameters as "16M" and "48M" as you would expect on the java command line. But you must define them as a number of bytes. However the resulting Info.plist now looks like this


VMOptions

-Xms16M
-Xmx48M



Go figure !?!? You live and you learn, I guess.

Anyway, my application seems to be working now.

Thanks again for the direction, it really helped a lot.

cartouchbea
0 Kudos