Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm Running Out of Memory

Tags:

python

pycharm

I've recently started getting an out of memory error while using PyCharm 5.0.4 The message is:

There's not enough memory to perform the requested operation. Please increase Xmx setting and shutdown PyCharm for change to take effect.

I've already increased the value to 1024 MB, and to my knowledge nothing has changed in either my Python or system setups.

What exactly does the size of the Xmx memory manage, and how would I go about debugging what's causing the issue?

like image 709
Batman Avatar asked Mar 21 '16 17:03

Batman


People also ask

How much memory should PyCharm use?

PyCharm recommends 1 GB of RAM as stated in the system requirements at the PyCharm website.

Does PyCharm take a lot of memory?

Running pycharm consumes around 4.5-5G or ram. Max heap size is set to 2G.

How do I increase memory in Python?

Python doesn't limit memory usage on your program. It will allocate as much memory as your program needs until your computer is out of memory. The most you can do is reduce the limit to a fixed upper cap. That can be done with the resource module, but it isn't what you're looking for.


2 Answers

What worked for me when I ran into this "Out of Memory" problem was clearing the cache. ("File -> Invalidate Caches / Restart...") It's been a couple days and no further problems. Before, it was happening five or ten minutes after starting PyCharm, even with me not doing anything on PyCharm other than look at it.

I'm running PyCharm Community Edition 2016.1.4 on Windows 7 Enterprise.

like image 99
BobInBaltimore Avatar answered Sep 23 '22 11:09

BobInBaltimore


I had the same issue where I keyboard on Pycharm was not responding anymore.

The following solved my issue both on Windows 10 and MacOsx

Click on help on the menu

Help -> Edit custom VM options 

Create the file when prompted.

Either change the settings to the following or replace the entire content of the file with the following:

-Xms512m -Xmx2024m -XX:MaxPermSize=700m -XX:ReservedCodeCacheSize=480m 
like image 24
Stryker Avatar answered Sep 19 '22 11:09

Stryker