Fix - Pycharm Failed to create JVM

- How to Run your Pycharm IDE under 64bit JVM..?

Pycharm Error Code -4

What is the real issue..?

First you should to know all jetbrains IDE's are written in Java. The issue because of your pycharm needs more memory to process your projects and files at the backend Java requires memory. But its not able to acquire that much of memory. So its closed obtrubtly.

Everyone will say increase the JVM/Java max heap size in pycharm.properties file. Then restart the pycharm. But thats not a permanent solution.

The real problem is pycharm internally uses 32bit jvm which comes with the installer package. The 32 bit JVM can allocate maximum 2GB of space only.

What is the solution for it..?

So the fix is you have to start your pycharm with 64bit JVM. Here we will see how to start with 64bit JVM. Three steps to fix that

  • Set the 64bit SDK as environmental variable
  • create properties for 64bit version
  • start the ide from .bat file

Set 64Bit SDK:

Before setting environmental variable you have to find out which version of java you are using. To find out Open Command Prompt → Then run the below command

java -version

It should have the "Java Hotspot(TM) 64-Bit Server" line in the output. If there is no Bit information then its 32bit java. Then proceed furthur you have to download and install the 64bit JDK from http://java.com/

Java Version

Then open Control Panel → Edit Environmental Variable for Your Account

In User variables set PYCHARM_SDK and path will be your 64 bit java version

PYCHARM_JDK

Create properties file:

For 64bit you have to create separate properties file for that.  Create file named as pycharm64.exe.vmoptions in the root directory of IDE

-server
-Xms256m
-Xmx2048m
-XX:MaxPermSize=512m
-XX:ReservedCodeCacheSize=128m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseCodeCacheFlushing
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=100

To start:

IDE should start with the pycharm.bat file.

This fix will work for other IDE such as WebStrom, PhpStrom, IntelliJ and RubyMine from jetbrains also.

Basically you have to create <product>64.exe.vmoptions file. Set the 64bit Java environmental variable for that IDE. Then start the <product>.bat file

Environmental Variable for Different product:

  • IDEA_JDK for IntelliJ IDEA
  • WEBIDE_JDK for PhpStorm and WebStorm
  • PYCHARM_JDK for PyCharm
  • RUBYMINE_SDK for RubyMine

To know about what environmental variable have to use, open <product>.bat file. Then you will get to know.

pycharm.bat

Read More at intellij Support

Show Comments
\