Ubuntu下提升 PhpStorm 性能的可行方案
一 内存与 JVM 参数优化
-Xms128m
-Xmx2048m
-XX:ReservedCodeCacheSize=240m
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-XX:HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
说明:-Xmx 是最大堆内存,建议根据物理内存适度上调(如 2–4GB);修改前先备份原始文件。若需进一步加速 UI 渲染,可追加:-Dawt.usesystemAAFontSettings=lcd
-Dawt.java2d.opengl=true
提示:新版 JDK 可能已弃用部分 GC 参数,如出现警告可移除相关行并仅保留必要参数。二 索引与插件优化
三 项目与运行环境配置
zend_extension=xdebug.so
xdebug.remote_enable=1
xdebug.remote_host=localhost
xdebug.remote_port=9001
xdebug.remote_autostart=1
xdebug.profiler_enable=1
xdebug.profiler_output_dir="/tmp"
xdebug.idekey=PHPSTORM
注意:Xdebug 会显著降低执行速度,仅在调试时启用,日常开发建议关闭或改用 Xdebug 3 的 “develop,debug” 模式按需开启。四 系统与硬件层面优化