Pycharm Pro 2018.1 - Memory Consumption/Speed
Memory consumption almost tops 1.5 GB. when I restart PyCharm opening the same project it's at 0.6gb. which is still rather high. the little meter thingie on the lower right (I am assuming this is some kind of a memory use deal) always has a max of 725M When at the 1.5GB that meter is close to that 725. after restart it reads a tad over 100. I am not entirely sure where it gets it's measurements from But if it is supposed to reflect the memory use it is horribly inaccurate.
Not sure what the deal is with the CPU use bouncing all over the place all the way up to 95+ use. even if I just walk away for an hour and come back the thing is still all over the place. The responsiveness of PyCharm when this is going on makes it completely unusable, and having the close and reopen all the time to be able to work for 15 minutes then have to do it all over again. Thats crazy!!!!.. I had the same issue when running 2017 as well. I did a complete remove and reinstall and still the same thing happens.
I also have an issue where randomly it will simply hang if i go into the settings menu. There are no errors and I have to kill the process. Once it does this it keeps on doing it until i load a .py file from the windows context menu and that file has to not be associated with any project. then I can load my project and enter the settings menu.
The only plugin I have installed other then the default ones is MarkDown Navigator.
I am not sure what the issue is or how I can trouble shoot it, any help is appreciated.
Thanks again
Please sign in to leave a comment.
Hi Drschlosser,
Thank you for contacting PyCharm support.
Please use this instruction to report a performance problem https://intellij-support.jetbrains.com/hc/en-us/articles/207241235-Reporting-performance-problems
We will investigate the issue.
Looking forward to your reply.
Kind regards,
Sergey
https://www.jetbrains.com
The Drive to Develop
I wanted to let you know my machine specs.
Windows 7 x64 SP1
6 cores @ 3.2GHz
8GB RAM
SSD @ 42K Read/Write IOPS
So I am pretty sure it is not an issue with the machine not being strong enough to handle PyCharm.
I have the same problem ram at 1.3G and when python is working up to 2G ram.
PyCharm 2018.2.4 (Professional Edition)
Build #PY-182.4505.26, built on September 19, 2018
Licensed to Boaz Dori
JRE: 1.8.0_152-release-1248-b8 amd64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
sys config
i7 5600U CPU 2.6GHz
8G ram
64bit win 10
I ended up needing to upgrade my memory. and depending on the size of your actual project you may have to as well. It all depends on what your free ram is and how large of a page file you want to have. I wanted a very small page file. mine is only 200 meg. I do not want to beat up my SSD because of page faults. I do not know as to why the default settings are set in a manner that causes issues in PyCharm but I will give you some brief instruction on how to change them and what I use.
This is over simplified but with PyCharm we are going to separate it's memory allocation into 2 sections. One being the heap. and the other being the memory used by the core. They are not one in the same thing. The bits that get loaded and are needed for PyCharm to run is not apart of the heap allocation. This is why you see a memory consumption greater then the heap allocation. The requirements posted by JetBrains is very optimistic. PyCharm uses about 1GB of memory. that is the core.. That is once everything is loaded. This in fact is not the minimum required. as what the requirements state. This is what is needed if you want to simply open PyCharm and look at it i guess. But not actually create/code anything projects/inspections things of that nature get loaded into heap. This is the other chunk of memory. This is "supposed to be" a dynamic use of memory. It is not in fact. it is dynamic only one way.. it grows.. it never shrinks. This is a Java downfall. they have the mentality that if it used the memory once. we will hold onto it because it may get used again, this is bonkers in my opinion because of the dynamic nature of memory use. So you will always need to constantly open and close PyCharm to free up memory. Its an annoying thing. Even with doubling my physical ram i still have to do this. albeit less often. but it still needs to be done.
The heap allocation can be adjusted to suit your needs. The reason why the UI gets all kinds of special ed is because when the heap is close to being used up that is when PyCharm is set to garbage collect. this process is what frees up heap memory for use elsewhere. The problem is that garbage collection is expensive and it also causes everything else that is going on to come to a grinding halt until it is done. Hence the "lagging". So with some changes to how the GC "garbage collector" works. and when it is supposed to do it's job as well as making adjustments to the heap your performance will become vastly better. However you will still run into issues if you are dealing with extremely large projects. and The restarting of PyCharm is still going to have to take place.
To edit the settings..
click on help
click on edit custom VM options
if it asks you to make a file. go ahead and OK that.
in that new file delete everything in there and paste in the following
the -Xms1024m is the minimum size of the heap. you can change the 1024 to anything you like. tho i would suggest leaving it where it is or setting it higher. allocating memory is an expensive thing to do so setting this to be about what you average consumption is is ideal.
the -Xmx2048m is the maximum heap allocation. this is what the heap can grow to. this is something you will need to tinker with a but depending on what your memory use is on your PC. But if you are anything like me this will be the max you can set it to with having 8gb or ram before running out of memory (if you have a small page file).
the other settings that have the 256 in them deal with the other side of the memory allocation. what the core uses. this is above the heap allocation. so if 2048 is your max heap. then expect to see 3gb consumed for the process.
the -XX:+CMSInitiatingOccupanctFraction=60 is the percentage of heap use before garbage collection starts. because it is going to garbage collect at a much lower level then the stock setting it is not going to cause the huge pauses in the UI. you may get very tiny ones here and there if the data being collected is large. You can change this percentage to tweak it.
The end game is if you have a project of 100K lines+ you will need to upgrade your RAM to at least 16GB. I should have gone to 32 GB because of running VS and PyCharm at the same time and dealing with 200K+ lines of code. But even with these changes when I had 8 it did make a startling improvement. and the jump to 16 and adjusting the numbers doubled that improvement. I have PyCharm set to use an 8GB heap and i still run out of memory. I have a 32 GB Kingston SSD that has a pretty high IOPS that I am going to install only for use as a page file. enable write caching on it so I get the same write performance as the read performance and that should solve the memory issue for me. the cost was about 20 bucks for it and if I burn it up I won't be all that upset and I am not going to have data loss.
If you booger something up with that options file. If you go to your user profile in the PyCharm/Settings folder you will see a file with the extension of vmoptions. depending on if you are using 32 or 64 bit depends on what the file name is but it will either be pycharm.vmoptions or pycharm64.vmoptions. You can simply delete this file or you can edit it and make any changes needed to get PyCharm back up and running. If you get any errors when starting PyCharm or it simply bombs if you made a change to this file then that is where the problem is going to be. Do not pay attention to the error messages. they will send you off on a wild goose chase in some cases.
This is the quick and dirty solution. also the least expensive.
Let me know if it helps or not. if not there could be some other options to make it perform better..
Kevin
Let me know how you make out.