优化 Ubuntu 下 PHPStorm 的性能和体验,可以从 系统环境、PHPStorm 配置、插件与项目设置、JVM 调优 四个方面来做。下面给你一套比较实用的优化方案(从“立竿见影”到“进阶”)。
PHPStorm 是 IO + 内存密集型 工具:
sudo systemctl disable bluetooth
sudo systemctl disable cups
减少后台资源占用。
powerprofilesctl set performance
(适用于笔记本)
编辑:
~/.config/JetBrains/PhpStorm*/phpstorm64.vmoptions
推荐配置(16G 内存机器):
-Xms2048m
-Xmx4096m
-XX:ReservedCodeCacheSize=512m
-XX:+UseG1GC
-XX:SoftRefLRUPolicyMSPerMB=50
⚠️ 不要盲目设太大,
Xmx超过物理内存反而更慢
Settings → Plugins
建议禁用:
只保留你 真正用的语言 & 框架插件
Settings → Directories
标记为 Excluded:
vendornode_modulesstoragecachepublic/uploads.git✅ 能显著减少 CPU 占用
Settings → Editor → Inspections
推荐:
Recent Projects 过多Settings → Appearance & Behavior → System Settings
Save files on frame deactivationSave files automatically手动 Ctrl + S 更流畅
Settings → Tools → File Watchers
Help → About
确认:
Runtime version: JetBrains Runtime
如果不是,建议重装 PHPStorm(官方包)
export GDK_SCALE=1
export GDK_DPI_SCALE=1
或在 PHPStorm VM 参数加入:
-Dsun.java2d.uiScale=1
❌ Snap 版本 性能明显更差
✅ 建议:
.tar.gz/opt/phpstormcomposer config --global no-autoloader true
或 PHPStorm 中:
Settings → PHP → Composer
取消 ✅ Synchronize IDE with composer
✅ 内存 ≥ 4G
✅ vendor / node_modules excluded
✅ 禁用无用插件
✅ 不用 Snap 版
✅ 不在机械硬盘
你可以直接告诉我:
Ubuntu 版本 + PHPStorm 版本 + 内存大小 + 主要开发语言