Kubadev
Kubadev

Reputation: 865

PHPStorm7 "Failed to create JVM: error code -4" on startup

So today I tried to run my PHPStorm7 IDE and I got this error :

Imgur

I get a "Failed to create JVM error"; how can I avoid it?

I found this related issue, but it didn't help me.

Upvotes: 7

Views: 8797

Answers (4)

Davideas
Davideas

Reputation: 3276

Probably you were using 64bit version as me, if so change the shortcut launcher from {path}\PhpStorm.exe to {path}\PhpStorm64.exe

This worked for me without any other trick.

Upvotes: 3

Rufus
Rufus

Reputation: 1

I had the same problem after updating my computer (Ubuntu), I solve this issue by removing the line -XX:MaxPermSize=350m

Upvotes: 0

Kubadev
Kubadev

Reputation: 865

So i just fixed my problem thanks to @lena :

Edit the Phpstorm.exe.vmoptions file (IDE_HOME\bin\Phpstorm.exe.vmoptions) :

-Xms128m
-Xmx2048m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false

And reduce -Xmx value step by step reducing by 100m every time until it starts.

Upvotes: 31

lena
lena

Reputation: 93728

This is JVM problem; Oracle JVM requires a single chunk of continuous memory (more or less equal to the sum of Xmx and XX:MaxPermSize parameters values) to initialize. On Windows systems 32-bit java can only allocate up to 1.5 Gb. And any libraries that inject themselves into process memory will reduce this solid block.

You can try to cleanup your system and uninstall/disable as many of such autoloading stuff as possible (context menu extensions, residental programs that can intercept global keys (e.g. Translator/Dictionary, IM, fraps, some graphic drivers have "hot keys" etc etc). The PhpStorm.exe launcher can itself cause additional fragmentation, thus I'd suggest using PhpStorm.bat instead.

see also https://jetbrains.zendesk.com/entries/23393413 for some hints

Upvotes: 5

Related Questions