Setting JVM memory - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Setting JVM memory

In the installed run time, I set the JVM memory to be

-Xms20:256:384P -Xmx80:512:1024P

Which I interpreted as min at 20% of current RAM but not less than 256 or more than 384, max at 80% of current RAM but not less than 512 or more than 1GB.

That works fine, but I do get JNI exception: failed to create the Jave VM Reason: not enough memory on machines with lots of memory, i.e. 2GB. This made sense when the requirement was at max 80% as the system could not get 80% continues memory at run time. However, since I specify -Xmx80:512:1024P I would expect that 512 would satisfy the start condition.

So, can you shed some light on that? What is wrong in the command line? Do I misinterpret the usage of those values? What are the safest values to use that will not penalize people with 512MB machines but still will take advantage when you have 2GB?

Thanks

-Yishai
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Setting JVM memory

Hi,

I'm not sure why you are encountering this behavior. I attached to this post the debug version of the Java Launcher, please follow these steps:
- install your package
- extract the files
- if your Java application uses an UI rename the "aijclw.exe" file to the name of the Java Launcher in the installation folder
- otherwise, rename the "aijcl.exe" file to the name of the Java Launcher in the installation folder
- replace the original Java Launcher with the file you renamed
- launch it

This way, when you run the Java Launcher it will create a log next to it. Please attach this log so we can investigate it.

Regards,
Cosmin
Attachments
Java.zip
(290.04 KiB) Downloaded 425 times
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
cssgroup
Posts: 1
Joined: Thu Apr 03, 2008 8:43 pm

Re: Setting JVM memory

The aijclw.exe runner works well for diagnosing issues on XP. When we try it Win 2000 however, it does not work.
Log file contains
2008-8-13 : 16.2.7.218 Application started
2008-8-13 : 16.2.7.218 Failed to load resources DLL
2008-8-13 : 16.2.7.218 Application or JavaClassLoader failed to initialize
2008-8-13 : 16.2.7.218 Application return code = -1
2008-8-13 : 16.2.7.218 Application ended

--Update
Machine did not have aijcl-res.dll.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Setting JVM memory

Hi,
Machine did not have aijcl-res.dll.
Please note that the "aijcl-res.dll" file must be placed next to the debug version of the Java Launcher (in the installation folder of your package).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Setting JVM memory

Hi,

If the problem persists you can try using smaller values. For example, you can try using -Xmx80:512:700P .

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
yishai
Posts: 54
Joined: Wed Nov 23, 2005 11:54 pm

Re: Setting JVM memory

I didn't get more info from the user, so it has to stay on the theoretical level...

I want a value that will work on any machine regardless if it has 512MB or RAM or 2GB. I thought the % with a min/max boundaries will work, as with a machine with little memory the % will be the max, while on a machine with lots of memory that max size will cap the % to be the max.

Since the problem happens on machine with 2GB, it looks as if the top boundary is ignored. If this is the case, not sure a lower value will do the trick.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Setting JVM memory

Hi,

The top boundary is not ignored, it is simply too high. I think that if you use a lower maximum value it will work as expected. Here is a similar thread in which you can find more information:
http://www.advancedinstaller.com/forums ... ?f=2&t=968

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”