Reputation: 8927
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?
Upvotes: 39
Views: 83381
Reputation: 11580
In the latest pycharm edition, increase memory using below option
Help -> Change memory settings
Here enter the amount of memory you need.
Upvotes: 15
Reputation: 487
In my case I accidentally added a huge image to git (it weights about 1GB). This error only showed when I tried to make a commit. When I unmarked the image from git, the error stopped appearing.
Upvotes: 0
Reputation: 11
I'm using Windows 10 and suddenly this message started popping up a lot, and even freezing Pycharm. My solution was delete the temporal files.
Windows + r: run/
or just write run
, and execute: %temp%
, then delete all of the files.
Upvotes: 1
Reputation: 99
In my case, I had printed tons of output while running a cell. Pycharm could not cope up with this and constantly asked me to increase memory (even if I increased in).
I opened up the .ipynb file in notepad and deleted all the outputs. It worked.
Try to look for pieces of text titled as
"outputs": [ { "name": "stdout", "output_type": "stream",....
And just delete those.
Upvotes: 0
Reputation: 677
I couldn't get the number at the bottom right to change (e.g. "300 of 768M"). Turns out it is Xmx memory and some of the options only seem to change Xms memory.
The answer about Help -> Edit Custom VM Options is correct (you can change is the different types of memory there).
Another thing that worked for me was on PC to set (in the DOS prompt, right before starting the application from that same DOS prompt) the _JAVA_OPTIONS value, e.g.:
set _JAVA_OPTIONS=-Xmx2048M
Upvotes: 0
Reputation: 41
The issue for me was the css plugin installed in Pycharm. Removing it fixed the problem. To remove, go to the Project Interpreter in Pycharm preferences.
Upvotes: 4
Reputation: 51
I had the same issue when I change the background image, the picture is 16.4MB.enter image description here, when I modify the Custom VM options and increase -Xxm to 4096MB, it works. But I do not change the background image.
Upvotes: 0
Reputation: 467
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.
Upvotes: 33
Reputation: 20643
Running your script with Python Console in PyCharm might keep all previously used variables in memory and does not exit from the console. Thus, repeatedly running the script might cause out of memory or can't allocate memory in GPU or CPU.
I realized this while debugging my tensorflow code. If you are not sure, go to Run -> Edit Configuration and make sure to uncheck "Run with Python Console."
Upvotes: 0
Reputation: 6120
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
Upvotes: 22
Reputation: 39
I had the same problem. Reinstalling the PyCharm did not help. I think this problem happens when we have a large project size (also, mentioned in https://youtrack.jetbrains.com/issue/PY-20429). I simply cut some of the folders including some results (txt files) from my project and saved them in another directory. Now, I do not get the "out-of-memory" error and the changes can be committed successfully.
Upvotes: 1
Reputation: 1195
There is already a bug reported for this in Youtrack: https://youtrack.jetbrains.com/issue/PY-20429
As mentioned in the comments there, you can try to profile the CPU usage (instructions here https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems) and report it there. I've noticed that killing all my debuggers, putting it in power save mode and then reverting this helps.
In case you are using docker, be aware that Pycharm has some problems with creating multiple docker instances and not killing them. You will have to kill them manually.
Upvotes: 1