pycharm running wayyyy slow

I'm a big fan of PyCharm by JetBrains but I do run into some issues that I thought maybe I'll ask here about.

  • It hangs unexpectedly and this happens often. Overall, its a little bit slow for my taste and I would love some tips on how to increase the performance of the IDE
  • Often when I open a project PyCharm seems to flag all the built-ins as Unresolved Reference warnings. things like open(), str(), etc. as well as some of the modules I import such as sys (these are the most common offenders :) ).
  • The only way I am able to fix (2) is by going to PyCharm -> Preferences -> Python Interpreters -> Paths -> Reload List of Paths but I have to do this often enough to warrant asking about a more permanent fix.

    My configuration: Mac OSX Lion running on MacBook Pro (mid 2010) with 8GB RAM

    Now look, I understand that diagnosing things like these is difficult without any sort of snapshot or more information about what is going on, but I am simply asking if anyone has ran into these issues before and if so, how did these get resolved?

    Thanks!

    PS I have also contacted JetBrains regarding these issues, but honestly I tend to find nice solutions to common problems here and I thought I might as well ask


    Every performance problem with PyCharm is unique, a solution that helps to one person will not work for another. The only proper way to fix your specific performance problem is by capturing the CPU profiler snapshot as described in this document and sending it to PyCharm support team, either by submitting a ticket or directly into the issue tracker.

    After the CPU snapshot is analyzed, PyCharm team will work on a fix and release a new version which will (hopefully) not be affected by this specific performance problem. The team may also suggest you some configuration change or workaround to remedy the problem based on the analysis of the provided data.

    All the other "solutions" (like enabling Power Save mode and changing the highlighting level) will just hide the real problems that should be fixed.


    1. Change the inspection level

    Current PyCharm versions allows you to change the type of static code analysis it performs, and also features a Power/CPU Saving feature (Click on the icon at the bottom right, next to the lock):

    在这里输入图像描述

    2. Change indexed directories
    Exclude directories from being indexed which are set in the project paths but not actually required to be searched and indexed. Press ALT+CTRL+S and search for project .

    3. Do memory sweeps
    There is another interesting feature:

    Go into the settings (File/Settings) and search for memory. In IDE Settings>Appearance -> tick Show memory indicator . A memory bar will be shown at the bottom right corner (see the picture below). Click this bar to run a garbage collection / memory sweep .


    Well Lorenz Lo Sauer already have a good question for this. but if you want to resolve this problem through the Pycharm Tuning (without turning off Pycharm code inspection). you can tuning the heap size as you need. since I prefer to use increasing Heap Size solution for slow running Pycharm Application.

    You can tune up Heap Size by editing pycharm.exe.vmoptions file. and pycharm64.exe.vmoptions for 64bit application. and then edit -Xmx and -Xms value on it.

    So I allocate 2048m for xmx and xms value (which is 2GB) for my Pycharm Heap Size. Here it is My Configuration. I have 8GB memory so I had set it up with this setting:

    -server
    -Xms2048m
    -Xmx2048m
    -XX:MaxPermSize=2048m
    -XX:ReservedCodeCacheSize=2048m
    

    And I enable "Show memory indicator" in settings->Appearance & Behavior->Appearance. to see it in action :

    and Pycharm is quick and running fine now.

    Reference : https://www.jetbrains.com/help/pycharm/2017.1/tuning-pycharm.html#d176794e266

    链接地址: http://www.djcxy.com/p/44940.html

    上一篇: 无法在webstorm上调试JavaScript

    下一篇: pycharm运行wayyyy缓慢