Could somebody please explain why PyCharm caches folder is so big?
Hello,
Could somebody please explain why PyCharm caches folder is so big? I ran the disk usage program (ubuntu 18.04) and got this:
How can I reduce the size of this folder and prevent it from becoming so big again?
Thanks
Ciaran
请先登录再写评论。
Hi Ciaran,
Do you use any symlinks in your projects?
Could you please share your ~/.<product_version>/config/options/jdk.table.xml file?
To reduce its size you can first try File | Invalidate Caches / Restart....
Hi Sergey,
No I don't generally use symlinks - have large data folders though, was thinking maybe something to do with that? I actually tried invalidating caches and restarting before I shared my disk usages.
Here is the contents of `jdk.table.xml`
Thanks
Ciaran
<application>
<component name="ProjectJdkTable">
<jdk version="2">
<name value="Python 3.7 (ncw135)" />
<type value="Python SDK" />
<version value="Python 3.7.3" />
<homePath value="$USER_HOME$/miniconda3/bin/python" />
<roots>
<classPath>
<root type="composite">
<root url="file://$USER_HOME$/miniconda3/lib/python3.7" type="simple" />
<root url="file://$USER_HOME$/miniconda3/lib/python3.7/lib-dynload" type="simple" />
<root url="file://$USER_HOME$/miniconda3/lib/python3.7/site-packages" type="simple" />
<root url="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/478056651" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/python-skeletons" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2and3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/2and3" type="simple" />
</root>
</classPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional ASSOCIATED_PROJECT_PATH="$USER_HOME$" />
</jdk>
<jdk version="2">
<name value="Python 3.7 (py37)" />
<type value="Python SDK" />
<version value="Python 3.7.3" />
<homePath value="$USER_HOME$/miniconda3/envs/py37/bin/python" />
<roots>
<classPath>
<root type="composite">
<root url="file://$USER_HOME$/miniconda3/envs/py37/lib/python3.7" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py37/lib/python3.7/lib-dynload" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py37/lib/python3.7/site-packages" type="simple" />
<root url="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/-749777340" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/python-skeletons" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2and3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/2and3" type="simple" />
</root>
</classPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional ASSOCIATED_PROJECT_PATH="$USER_HOME$/Documents/MesiSTRAT/CrossTalkModel" />
</jdk>
<jdk version="2">
<name value="Python 3.6 (py36)" />
<type value="Python SDK" />
<version value="Python 3.6.8" />
<homePath value="$USER_HOME$/miniconda3/envs/py36/bin/python" />
<roots>
<classPath>
<root type="composite">
<root url="file://$USER_HOME$/miniconda3/envs/py36/lib/python3.6" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py36/lib/python3.6/lib-dynload" type="simple" />
<root url="file://$USER_HOME$/.local/lib/python3.6/site-packages" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py36/lib/python3.6/site-packages" type="simple" />
<root url="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/-878860059" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/python-skeletons" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2and3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/2and3" type="simple" />
</root>
</classPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional />
</jdk>
<jdk version="2">
<name value="Python 3.6 (py36-new-pycotools)" />
<type value="Python SDK" />
<version value="Python 3.6.8" />
<homePath value="$USER_HOME$/miniconda3/envs/py36-new-pycotools/bin/python" />
<roots>
<classPath>
<root type="composite">
<root url="file://$USER_HOME$/miniconda3/envs/py36-new-pycotools/lib/python3.6" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py36-new-pycotools/lib/python3.6/lib-dynload" type="simple" />
<root url="file://$USER_HOME$/.local/lib/python3.6/site-packages" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py36-new-pycotools/lib/python3.6/site-packages" type="simple" />
<root url="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/157503001" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/python-skeletons" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2and3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/2and3" type="simple" />
</root>
</classPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional />
</jdk>
<jdk version="2">
<name value="Python 3.6 (py36-old-pycotools)" />
<type value="Python SDK" />
<version value="Python 3.6.8" />
<homePath value="$USER_HOME$/miniconda3/envs/py36-old-pycotools/bin/python" />
<roots>
<classPath>
<root type="composite">
<root url="file://$USER_HOME$/miniconda3/envs/py36-old-pycotools/lib/python3.6" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py36-old-pycotools/lib/python3.6/lib-dynload" type="simple" />
<root url="file://$USER_HOME$/.local/lib/python3.6/site-packages" type="simple" />
<root url="file://$USER_HOME$/miniconda3/envs/py36-old-pycotools/lib/python3.6/site-packages" type="simple" />
<root url="file://$USER_HOME$/.PyCharm2019.1/system/python_stubs/282276850" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/python-skeletons" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/stdlib/2and3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/3" type="simple" />
<root url="file://$APPLICATION_HOME_DIR$/helpers/typeshed/third_party/2and3" type="simple" />
</root>
</classPath>
<sourcePath>
<root type="composite" />
</sourcePath>
</roots>
<additional ASSOCIATED_PROJECT_PATH="$USER_HOME$/Documents/MesiSTRAT/CrossTalkModel" />
</jdk>
</component>
</application>
Haven't found anything unusual in jdk.table.xml
>have large data folders though, was thinking maybe something to do with that?
Is it inside of your project? It could be that PyCharm is indexing them and hence the caches folder grows bigger. The solution in such cases is to store these files outside of your project or mark them as Excluded.
I tried renaming that folder on my side (to test if it's safe to remove it) and it seems to be fine.
Update: found a solution:
I just tried to mark all my data directories as excluded in my projects, and then remove all files under the caches directory. After I restart PyCharm and re-index my projects, the caches directory shrink from a hundred GB to just several MB!
== Origin post ==
My caches directory is more than a hundred GB large. I do symlink the ImageNet dataset, which is more than a hundred GB large, to one of my project directory. Is that the cause of the large caches? If it is, how can I solve it? Thank you!
Hi, I have similar issue,It is draining my whole disk. 225GB because it can not use more than that, otherwise i assume it will fill the remaining part too. The file packages_v2.json is 209GB big ... (du -a --block-size=1G)
I assume cyclic dependencies? but Pycharm should have handled that no? ofc I can't open the file, it just crashes the terminal.
Hello,
This is a known bug that has been solved in 2022.3.1.
You can download PyCharm 2022.3.1 RC from here: https://youtrack.jetbrains.com/articles/PY-A-23004355
The final version should be released next week if there won't be any blocking issues.
I apologize for the inconvenience.
Hello,
I had same problem with Pycharm.
You can follow below steps:
Run below commands to get size of caches:
Just remote the caches and it will rebuild the caches again:
After Removing the cache files:
Thank You.