Pycharm佔用C盤空間越來越大 - 解決辦法

方法1. 修改HOME\idea.properties

因爲Pycharm項目緩存C:\Users\<username>\.PyCharm<2018.1>\system\caches下面的content.dat.storageData特別大,佔用很多C盤空間,所以要想辦法把這些設置移動到D盤

參考原文:https://intellij-support.jetbrains.com/hc/en-us/articles/207240985,可以實現

步驟:

1. 將C:\Users\<username>\.PyCharm<2018.1>下的所有文件複製到想要轉移的位置(e.g. D:/Program Files/.PyCharmCE2018.1)

2. 在C:\Users\<username>\.PyCharm<2018.1>\config下新建一個idea.properties

# custom PyCharm properties

idea.config.path=D:/Program Files/.PyCharmCE2018.1/config
idea.system.path=D:/Program Files/.PyCharmCE2018.1/system

或者直接在

Pycharm裏的Help/Edit Custom Properties的選項下面新建, 編輯內容同上。

3. 關閉Pycharm,刪除c盤的目錄:C:\Users\<username>\.PyCharm<2018.1>就可以省出一部分空間了。

方法二:修改IDE_HOME\bin\idea.properties文件

一般不用這個方法,因爲如果更新了bin文件下的原始文件,更新補丁時可能會引起衝突。

可以創建一個idea.properties副本,以便IDE_HOME\bin下面的原始文件保持不變,並且在更新補丁期間不會引起衝突。

1.  在pycharm安裝文件下的bin目錄中, 複製idea.properties文件到C:\Users\<username>\.PyCharm<2018.1>\config

2. 編輯以下信息:

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE config folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.config.path=${user.home}/.PyCharmCE/config
idea.config.path=D:/Program Files/.PyCharmCE2018.1/config

#---------------------------------------------------------------------
# Uncomment this option if you want to customize path to IDE system folder. Make sure you're using forward slashes.
#---------------------------------------------------------------------
# idea.system.path=${user.home}/.PyCharmCE/system
idea.system.path=D:/Program Files/.PyCharmCE2018.1/system

3. 如果需要,也可以用IDE指定的環境變量來覆蓋idea.properties 文件的默認路徑。

增加環境變量修改默認配置IDE的路徑

IDE讀取idea.properties文件的順序如下:

  1. Environment variable - 環境變量 (IDEA_PROPERTIES)
  2. Default IDE configuration directory
  3. HOME\idea.properties (HOME 指的就是系統用戶的home目錄e.g. C:\Users\John\.PyCharm45\idea.properties)
  4. IDE_HOME\bin\idea.properties

idea.properties 文件的環境變量:

  • IDEA_PROPERTIES — IntelliJ IDEA
  • CLION_PROPERTIES — CLion
  • APPCODE_PROPERTIES — AppCode
  • PYCHARM_PROPERTIES — PyCharm
  • DATAGRIP_PROPERTIES — DataGrip
  • STUDIO_PROPERTIES — Android Studio
  • WEBIDE_PROPERTIES — WebStorm
  • PHPSTORM_PROPERTIES — PhpStorm
  • GOLAND_PROPERTIES — GoLand
  • RIDER_PROPERTIES — Rider

例如: IDEA_PROPERTIES=C:\Users\USER\idea.properties

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章