Welcome Guest.   Make a donation to an author on the site November 24, 2014, 09:02:24 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Error while launching Java applications (solved)  (Read 6974 times)
Vanav
Member
**
Posts: 12

View Profile Give some DonationCredits to this forum member
« on: May 10, 2012, 01:16:41 PM »

I've seen interesting issue and found a workaround. I'm posting here in case anyone will have this issue too.

I have Java application with exe launcher and splash screen (“PhpStorm.exe”, “idea.exe”). Recently it stopped launching with error:
[copy or print]
The JVM could not be started. The maximum heap size (-Xmx) might be
too large or an antivirus or firewall tool could block the execution.
Error log of application:
[copy or print]
Creating JVM
ERROR: could not initialize JVM
Hiding splash screen
Default options are (“PhpStorm.exe.vmoptions”):
[copy or print]
-Xmx512m
FARR sometimes can launch application, and sometimes can not (error message). If I launch directly, it always works.

If I raise maximum heap size to 1200 MB (“-Xmx1200m”), FARR will never be able to launch application, but manual launch will still work.

This issue is explained here: "The JVM could not be started. The main method may have thrown an exception" error when starting idea.exe :: JetBrains Developer Community:
Quote
It happens because the native idea.exe executable built with the exe4j uses the splash screen which loads a dll (to decode the splash image) in the address space of the process. The jvm.dll loaded after the splash needs to allocate the heap memory in one chunk, however the dll loaded before the jvm.dll can fragment the address space (limited to 2GB for the 32-bit applications) too much and there will be no single chunk of free memory required for the JVM to initialize.

Depending on the other DLLs loaded, applications with DLL hooks and drivers installed on the system, IntelliJ IDEA may be not able to start even with relatively low heap size of 512m.
To make it work again with FARR you should uncheck (Program Options → Settings → Launching Files):
[ ] Use file launch helper utility

Alternative way - uncheck:
[ ] Always launch shortcuts directly instead of resolving links


You don't need to lower maximum heap size (-Xmx).
Seems that launch helper somehow changes memory allocation of child process and application can't launch.

I've unchecked “Use file launch helper utility” and all is working correct now (and I still can launch *.doc, Word 2010, etc).

Environment: Java 1.6.0_31, Windows 7 x64, FARR v2.105.01.
« Last Edit: May 10, 2012, 01:26:32 PM by Vanav » Logged
mouser
First Author
Administrator
*****
Posts: 33,692



see users location on a map View Profile WWW Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: May 13, 2012, 01:39:06 AM »

Thanks for posting this solution Vanav  thumbs up
I clearly have to study the side effects of some of those launch options in FARR..
Logged
Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.024s | Server load: 0.22 ]