[{"createTime":1735734952000,"id":1,"img":"hwy_ms_500_252.jpeg","link":"https://activity.huaweicloud.com/cps.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=V1g3MDY4NTY=&utm_medium=cps&utm_campaign=201905","name":"华为云秒杀","status":9,"txt":"华为云38元秒杀","type":1,"updateTime":1735747411000,"userId":3},{"createTime":1736173885000,"id":2,"img":"txy_480_300.png","link":"https://cloud.tencent.com/act/cps/redirect?redirect=1077&cps_key=edb15096bfff75effaaa8c8bb66138bd&from=console","name":"腾讯云秒杀","status":9,"txt":"腾讯云限量秒杀","type":1,"updateTime":1736173885000,"userId":3},{"createTime":1736177492000,"id":3,"img":"aly_251_140.png","link":"https://www.aliyun.com/minisite/goods?userCode=pwp8kmv3","memo":"","name":"阿里云","status":9,"txt":"阿里云2折起","type":1,"updateTime":1736177492000,"userId":3},{"createTime":1735660800000,"id":4,"img":"vultr_560_300.png","link":"https://www.vultr.com/?ref=9603742-8H","name":"Vultr","status":9,"txt":"Vultr送$100","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":5,"img":"jdy_663_320.jpg","link":"https://3.cn/2ay1-e5t","name":"京东云","status":9,"txt":"京东云特惠专区","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":6,"img":"new_ads.png","link":"https://www.iodraw.com/ads","name":"发布广告","status":9,"txt":"发布广告","type":1,"updateTime":1735660800000,"userId":3},{"createTime":1735660800000,"id":7,"img":"yun_910_50.png","link":"https://activity.huaweicloud.com/discount_area_v5/index.html?fromacct=261f35b6-af54-4511-a2ca-910fa15905d1&utm_source=aXhpYW95YW5nOA===&utm_medium=cps&utm_campaign=201905","name":"底部","status":9,"txt":"高性能云服务器2折起","type":2,"updateTime":1735660800000,"userId":3}]
<>C盘满了?
发现电脑硬盘占用过多,尤其对于经常使用 vscode 远程连接的开发者来说,动辄增加上百G的空间。C盘颜色都变红了。
有一种情况是 VScode 的缓存过多导致的。
每当新建一个 VScode 窗口,如果路径与上次不同,缓存就多一份文件夹,尤其是用 VScode 安装了 C/C++
拓展插件的开发者,没几个月,硬盘空间就得加几十G容量。
<>如何解决?
VScode 似乎并没有解决这个问题,毕竟缓存是有必要的。不使用远程连接,在缓存目录一般只有几个文件夹,空间占用很少,所以只发生在频繁远程连接的开发者身上。
缓存目录:
C:\Users\<YourName>\AppData\Roaming\Code\User\workspaceStorage\
一个缓存目录一般包含如下三个文件:
* state.vscdb 每开一个窗口就会有一个新的文件夹生成,只包含这个文件。2. state.vscdb.backup 和第二次打开窗口有关。
* workspace.json 保存了一个打开文件夹的路径。
*
有时会有 ms-vscode.cpptools 文件,在点击了一个 cpp 文件以后生成,和
c/c++拓展工具相关。这文件夹占用很大,所以,删除这个释放的空间才比较多。
说这些是为了说明,这些缓存文件都是些没用的东西,删掉就是了!
总之操作很简单,按照时间排序一下,除了最新的几个可能需要保留的,其余全部删除。当然,全部删除也没关系。但下次打开vscode ,上次 cpp
文件的开启记录就没了,需要重新点击打开了。