pycharm 실행 속도가 느림
나는 JetBrains 의 PyCharm을 좋아 하지만 여기에 대해 물어 볼만한 몇 가지 문제가 발생합니다.
- 예기치 않게 중단되며 자주 발생합니다. 전반적으로 맛이 약간 느리고 IDE의 성능을 높이는 방법에 대한 팁을 원합니다.
- 종종 프로젝트를 열 때 PyCharm은 모든 내장 기능을 미확인 참조 경고로 표시하는 것 같습니다. open (), str () 등과 같은 것들뿐만 아니라 sys와 같이 가져온 일부 모듈 (이것은 가장 흔한 범죄자입니다 :)).
(2)를 고칠 수있는 유일한 방법은 PyCharm-> Preferences-> Python Interpreters-> Paths-> Reload List of Paths로 이동하는 것이지만 더 영구적 인 수정을 요구하기에 충분할 정도로 자주해야합니다.
내 구성 : 8GB RAM이 장착 된 MacBook Pro (2010 년 중반)에서 실행되는 Mac OSX Lion
이제 이런 종류의 스냅 샷이나 어떤 일이 일어나고 있는지에 대한 더 많은 정보가 없으면 이와 같은 것들을 진단하는 것이 어렵다는 것을 알고 있습니다.
감사!
추신 : 나는 또한이 문제에 관해 JetBrains에 연락했지만 솔직히 나는 여기서 일반적인 문제에 대한 좋은 해결책을 찾는 경향이 있으며 물어볼 수도 있다고 생각했습니다.
PyCharm의 모든 성능 문제는 독특하며 한 사람에게는 다른 사람에게는 도움이되지 않는 솔루션입니다. 특정 성능 문제를 해결하는 유일한 적절한 방법은 CPU 프로파일 스냅 샷을 캡처하는 것입니다 이 문서에 설명 된대로 및 PyCharm 지원 팀에 보내는 , 하나 티켓을 제출하거나하여 이슈 트래커에 직접 .
CPU 스냅 샷을 분석 한 후 PyCharm 팀은 수정 작업을 수행하고이 특정 성능 문제의 영향을받지 않는 새 버전을 릴리스합니다. 팀은 제공된 데이터의 분석을 기반으로 문제를 해결하기위한 구성 변경 또는 해결 방법을 제안 할 수도 있습니다.
다른 모든 "솔루션"(절전 모드 활성화 및 강조 수준 변경)은 해결해야 할 실제 문제를 숨길 수 있습니다.
1. 검사 수준 변경
현재 PyCharm 버전을 사용하면 수행되는 정적 코드 분석 유형을 변경하고 전원 / CPU 절약 기능을 사용할 수 있습니다 (오른쪽 하단의 잠금 옆에있는 아이콘을 클릭).
2. 인덱싱 된 디렉토리 변경
프로젝트 경로에 설정되어 있지만 실제로 검색 및 인덱싱 할 필요는없는 인덱싱되는 디렉토리를 제외합니다. 를 누르고 ALT+CTRL+S
를 검색하십시오 project
.
3. 메모리 스윕 수행
다른 흥미로운 기능이 있습니다.
설정 (파일 / 설정)으로 이동하여 메모리를 검색하십시오 . 에서 IDE Settings>Appearance
-> 틱 Show memory indicator
. 오른쪽 하단에 메모리 바가 표시됩니다 (아래 그림 참조). 가비지 수집 / 메모리 스윕 을 실행하려면이 막대를 클릭하십시오 .
Lorenz Lo Sauer는 이미 이것에 대한 좋은 질문을 가지고 있습니다. 그러나 Pycharm Tuning을 통해이 문제를 해결하려면 (Pycharm 코드 검사를 끄지 않고). 필요에 따라 힙 크기를 조정할 수 있습니다. Pycharm 응용 프로그램을 느리게 실행하기 위해 힙 크기 솔루션을 늘리는 것을 선호하기 때문입니다.
pycharm.exe.vmoptions 파일을 편집하여 힙 크기를 조정할 수 있습니다. 64 비트 응용 프로그램의 경우 pycharm64.exe.vm 옵션. 그런 다음 -Xmx 및 -Xms 값을 편집하십시오.
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
save the setting, and restart IDE. 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
In my case, the problem was a folder in the project directory containing 300k+ files totaling 11Gb. This was just a temporary folder with images results of some computation. After moving this folder out of the project structure, the slowness disappeared. I hope this can help someone, please check your project structure to see if there is anything that is not necessary.
It is super easy by changing the heap size as it was mentioned. Just easily by going to Pycharm HELP -> Edit custom VM option ... and change it to:
-Xms2048m
-Xmx2048m
Regarding the freezing issue, we found this occurred when processing CSV files with at least one extremely long line.
To reproduce:
[print(x) for x in (['A' * 54790] + (['a' * 1421] * 10))]
However, it appears to have been fixed in PyCharm 4.5.4, so if you experience this, try updating your PyCharm.
I found a solution to this problem that works beautifully on Windows, and wanted to share it.
Solutions that didn't work: I have 16GB of RAM and was still having horrible lag. PyCharm takes less than 1GB of RAM for me, so that wasn't the issue. Turning off inspections didn't help at all, and I didn't have any special plugins that I recall. I also tried playing around with CPU affinities for the process, which briefly worked but not really.
What worked beautifully, almost perfectly:
- Set PyCharm's CPU priority to Above Normal
- Set the CPU priority for Python processes to Below Normal
You can do this manually, but I recommend using a program which will preserve the setting across restarts and for multiple instances. I used Process Hacker: Right click on the process -> Priority -> Set the priority. Then right click again -> Process -> and select "Save for pycharm64.exe" and similarly for python "Save for python.exe." Finally in Process Hacker go to Options and select "Start when I log on." This will make it so that ALL Pycharm and python executables acquire these CPU priorities, even after restarting the program and/or Windows, and no matter how many python instances you launch.
Basically, much of the PyCharm's lag may be due to conflict with other programs. Think about it: Yes PyCharm requires a lot of CPU, but the PyCharm developers aren't stupid. They have probably at least ensured it can run without lag on an empty core. But now you open Chrome and 30 tabs, Fiddler, an FTP program, iTunes, Word, Slack, etc, and they all compete with PyCharm at the same CPU priority level. Whenever the sum of all programs > 100% on a core, you see lag. Switching to Above Normal priority gives PyCharm something closer to the empty core that it was probably tested on.
python.exe의 Under Normal은 기본적으로 자체 개발로 컴퓨터 속도를 늦추고 싶지 않습니다. 대부분의 파이썬 프로그램은 기본적으로 "일괄 처리"프로그램이므로 실행하는 데 추가 시간이 걸리지 않을 것입니다. 그래픽 대화식 프로그램을 개발하는 경우 권장하지 않습니다.
제 경우에는 매우 느리고 검사 설정을 변경해야했습니다. 모든 것을 시도했습니다. 유일한 것은 2018.2 버전에서 2016.2로 진행하는 경우가 있습니다. 때로는 일부 업데이트하는 것이 더 낫습니다 ...
참고 URL : https://stackoverflow.com/questions/10363526/pycharm-running-way-slow
'Programming' 카테고리의 다른 글
.aspx와 .ashx MAIN의 차이점 (0) | 2020.08.05 |
---|---|
간헐적 인 log4net RollingFileAppender 잠금 파일 문제 (0) | 2020.08.05 |
Django에서 현재 로그인 한 사용자의 사용자 ID를 얻는 방법은 무엇입니까? (0) | 2020.08.05 |
오류 메시지 엄격한 표준 : PHP에서 비 정적 메소드를 정적으로 호출하면 안됩니다 (0) | 2020.08.05 |
1,000,000 개의 웹 소켓을 열어두기 위해 몇 개의 시스템 리소스가 보유됩니까? (0) | 2020.08.05 |