在 Ubuntu 上使用 PhpStorm 出现卡顿,通常和 内存、JVM 参数、文件系统、索引、桌面环境 有关。下面按「最常见 → 进阶」给你一套实用排查和解决方案。
默认内存偏小,容易卡。
方法:
Help → Change Memory Settings或手动改:
~/phpstorm/bin/phpstorm64.vmoptions
示例(16G 内存):
-Xms512m
-Xmx4096m
-XX:ReservedCodeCacheSize=512m
改完重启 PhpStorm。
PhpStorm 卡,90% 是索引在跑。
操作:
Settings → Directories
vendornode_modulesstoragecachelogsSettings → Plugins
关闭:
如果是:
一定要:
Settings → File Watcher → 关闭
或:
idea.filewatcher.disabled=true
某些桌面环境很卡:
建议:
echo $XDG_SESSION_TYPE
如果是 wayland,登录时选 Ubuntu on Xorg
Settings → Appearance & Behavior
-Dsun.java2d.opengl=true
Settings → Appearance
不要系统 JDK:
phpstorm.sh
默认就用 JBR,别手动换 Oracle JDK。
~/.cache/JetBrains/PhpStorm*/log/idea.log
看是否有:
OutOfMemoryindexingfile watcher8G 内存:
16G 内存:
你可以告诉我:
我可以直接给你一套最优 vmoptions 配置。