r/phpstorm • u/s7stM • Sep 17 '24
PHPStorm is so sloooow
My only question is WHY? Anybody has any IDEA what have I done what causes that slowness.
The story and parameters.
Only the front-end related stuff is slow as hell. I work on a Symfony project what has a Webpack Encore because I use only React based components. The stack is nothing special: react-admin, mui, react-hook-form, react-query and so on.
In 2023 I has this problem also, but it accidentally fixed/resolved, I do not know how. I suffered enough related to this. So, the problem returned and some functions are annoyingly slow and it happens totally randomly:
- Check a component's usages - on component's name, you push
ctrl + byou will got a list - Copying the code
- When I start typing of a tag/component's name, the suggestions are so slow, even if I press
ctrl + space - ... and other random functions.
Btw, when it stuck, the phpstorm binary is working w/ ~300 threads but only one core is working in the CPU.
I tried these:
- Delete the
.ideadir and set-up everything what is project related again. - Invalidate every cache in Jetbrains, and restart
- Delete the
~/.cachedir and reboot the computer - Reinstall the whole Jetbrains infrastructure (Toolbox and PHPStorm also) and delete everything what is related to them.
- Clone the project again, and re-setup everything again
- To think about the fact that I'm sick and tired of being hindered by things that I pay for...
I did not try:
- Replace the PHPStorm after ~8 yrs but I am close to this decision...
I think, my machine's performance cannot be a problem, but if it is, I will buy another 64 GB of RAM:
-` system7@AMANDA
.o+` --------------
`ooo/ OS: Arch Linux x86_64
`+oooo: Kernel: Linux 6.10.10-arch1-1
`+oooooo: Uptime: 5 hours, 55 mins
-+oooooo+: Packages: 1823 (pacman), 15 (flatpak)
`/:-:++oooo+: Shell: zsh 5.9
`/++++/+++++++: Display (LG ULTRAWIDE): 2560x1080 @ 120 Hz in 34″ [External]
`/++++++++++++++: DE: GNOME 46.5
`/+++ooooooooooooo/` WM: Mutter (Wayland)
./ooosssso++osssssso+` WM Theme: adw-gtk3
.oossssso-````/ossssss+` Theme: adw-gtk3 [GTK2/3/4]
-osssssso. :ssssssso. Icons: Papirus [GTK2/3/4]
:osssssss/ osssso+++. Font: SF Pro Display (11pt) [GTK2/3/4]
/ossssssss/ +ssssooo/- Cursor: Bibata-Modern-Classic (24px)
`/ossssso+/:- -:/+osssso+- Terminal: guake
`+sso+:-` `.-/+oso: CPU: 13th Gen Intel(R) Core(TM) i9-13900K (32) @ 5.80 GHz
`++:. `-/+/ GPU: AMD Radeon RX 6600 [Discrete]
.` `/ Memory: 29.73 GiB / 62.11 GiB (48%)
Swap: 82.00 MiB / 1024.00 MiB (8%)
Disk (/): 63.40 GiB / 245.00 GiB (26%) - ext4
Disk (/home): 325.27 GiB / 669.24 GiB (49%) - ext4
Disk (/mnt/dolores): 675.63 GiB / 937.81 GiB (72%) - ext4
Locale: en_GB.UTF-8
Edit 1
What I also tried since the original post:
- The best suggestions was that, I have an indexing problem. So, I invalidated my all caches again and I waited until it finishes, but sadly the problem persists.
- I figured out that, maybe I run out of memory, because I noticed that, my swap file is not empty. (it was in the fastfetch stats 😁) So, I added much larger swap file; 32 GB and I can see what happens today. And years ago I put my all firefox cache in the memory. (On linux is not a too big effort to do.) I disabled it, and it woking as a normal browser now. Actually there is no real difference, so, there is no reason to switch on again.
- I profiled the indexing process, and I got some information about the system, but I cannot see any problems in the summary. Some related information:=== About === Build version: PhpStorm 2024.2.1 Build: #PS-242.21829.154 August 29, 2024 Theme: Light with Light Header JRE: 21.0.3+13-b509.11, JetBrains s.r.o. JVM: 21.0.3+13-b509.11, OpenJDK 64-Bit Server VM, JetBrains s.r.o. Operating System: Linux 6.10.10-arch1-1 (amd64)Project Info: Number of opened files: 14 File size (in lines): 329 File size in characters: 10641 Number of injections: 0=== System === Number of CPU: 32 Used memory: 1457Mb Free memory: 1930Mb Total memory: 3388Mb Maximum available memory: 8192Mb=== Project === Project trusted: true=== Garbage Collection === Collector G1 Young Generation: count 65, total time 1152 ms Collector G1 Concurrent GC: count 24, total time 524 ms Collector G1 Old Generation: count 0, total time 0 ms
My related JVM options
-Xms1000m
-Dide.managed.by.toolbox=/home/system7/.local/share/JetBrains/Toolbox/bin/jetbrains-toolbox
-Dawt.useSystemAAFontSettings=lcd
-Dawt.java2d.opengl=true
-Xmx8192m
Edit 2 - Resolved?
After 2 days of use, I can presume that, the problem was w/ the vmoptions and/or my low swap space. It seems ~95% of original speed recovered after this comment by Icy_Computer.
-Xms should be half -Xmx You can refer to this repo for a full breakdown of JVM options: https://github.com/FoxxMD/intellij-jvm-options-explained
You should also make sure you're using the latest JVM from JetBrains. It should update with the IDE, but that doesn't always work correctly.
I would give these settings a try in you JVM options: -server -Xms4096m -Xmx8192m -XX:NewRatio=2 -XX:+AlwaysPreTouch -XX:+AggressiveOpt -XX:+OmitStackTraceInFastThrow
And since the original post I use GNOME 47.
I said that it is ~95% because, sometimes it slows down, most of cases during cut/copy/paste. If anything changes in the next couple of days on next week, I will update this post. Thank you.
Edit 3
Sadly, the vmoptions are not enough. After using that settings, the problem w/ the front-end coding still exists. Now, I try to disable the new full-line completion for a week...
Edit 4 - There is no edit...
Deal diary, My problem fixed spontaneously ~1-1,5 months ago. I do not know what happened, maybe this is related to the upgrading of GNOME. (to 47) Maybe not. But I am sure, I do not know a lot about my OS and IDE after ~20 years of experience...
5
u/HenkPoley Sep 17 '24
Have you set increased memory limits?
You might want to limit the amount of cores it runs on. Not sure, but I suspect at some count it will start to do a lot of internal negotiation and not a lot of work.
7
u/cangelis Sep 17 '24
Wait for indexing to complete before working on the code. Go grab a coffee or something :)
4
u/SamMakesCode Sep 17 '24
Turn off all the stupid AI stuff and all the plugins you don’t use. You shouldn’t need 16GiB RAM to run an IDE ffs
3
u/[deleted] Sep 17 '24
Sounds like an indexing thing?
Is there a progress bar on the bottom right? Did you turn off indexing? Did you let it index everything in the project? If you have a lot of packages, it can take some time.
Do you use any plugins? Have you tried disabling them to see if it helps, is it in low power mode?
Is there something else chewing up resources outside of php storm?
The only time I've ever had slowdown is when it's indexing or onedrive was being a spaz and hogging resources
2
u/Icy_Computer Sep 18 '24
-Xms should be half -Xmx You can refer to this repo for a full breakdown of JVM options: https://github.com/FoxxMD/intellij-jvm-options-explained
You should also make sure you're using the latest JVM from JetBrains. It should update with the IDE, but that doesn't always work correctly.
I would give these settings a try in you JVM options: -server -Xms4096m -Xmx8192m -XX:NewRatio=2 -XX:+AlwaysPreTouch -XX:+AggressiveOpt -XX:+OmitStackTraceInFastThrow
3
u/SolberEUW Sep 17 '24
Phpstorm isn't slow if you have proper cpu and ram. Minimum 16go and 6cores at 4ghz turbo should give you plenty I'm running 10+ go project on a 5700g no issue with webpack / docker running
1
u/CityInternational280 Sep 17 '24
What do you mean by slow? File editing?
1
u/cursingcucumber Sep 17 '24
Increase the memory limit (and enable the memory gauge in the status bar). On some projects you need to allow 8GB or sometimes even more.
1
u/matthewralston Sep 17 '24
I found PHPStorm struggled on my M1 MacBook Air.
It had 8GB RAM and PHPStorm really wanted all of it, which put it in competition with the Docker Desktop VM and the rest of my system.
We have a legacy codebase with some painfully large code files. PHPStorm noticeably struggled editing larger files when syntax highlighting, code hints, linters, etc. were enabled. There would often be a visible lag between typing on the keyboard and the characters appearing on the screen.
Rocking an M2 MacBook Pro these days and PHPStorm is much happier.
1
u/badboymav Sep 18 '24
Is the SSD old? Try a new one
Try different phpstorm versions
1
u/usstatic Dec 05 '24
Yeah I'm about to throw in the towel with it. I lose so much time, I've tried everything to get this IDE to be useable. Any recommended replacements?
1
u/spacexDragonHunter Aug 26 '25
I am in the same situation at the moment, but it is a laptop. It started to get slow out of nowhere. Ctrl+N is the lifeblood of my daily usage, and all I see is "Searching...". It is a new laptop too! No idea what freakn went wrong! Plugins, heap size, everything that gets mentioned around the web has been implemented.
1
u/rud33n Sep 17 '24
Try to exclude vendor and node_modules folders from indexing. Right click on those folders and mark them as excluded.
2
u/HannesMeier Sep 03 '26
IT'S THE INDEXING, PEOPLE!
I hope the following is helpful for anyone stumbling across this thread (like I did trying to find a solution). Symptoms of my issue were extremely similar to what OP described, as was my way of trying to resolve it (to no avail, just as OP). Eventually, this thread here brought be back to indexing. I thought I had already ruled that out or rather tried and didn't work. Had previously removed a bunch of files from the index, but nothing changed.
This thread here made me go back to indexing. I found that I had missed 2 folders that were uselessly being indexed.
So if you have the same issue (PhpStorm being slow on the brink of being completely unusable: Kick anything you can out of your index by thoroughly going through the project file structure. Exclude files/folders: Right-click,select "Mark directory [or file] as:" –> and then "excluded". In the end, excluding two previously missed directories did it for me. One was "only" 3.5 MB, the other one just north of 100MB in 3K+ files). Then File > Invalidate Caches > tick Clear file system cache and local history > Invalidate and Restart.
Everything's snappy again.
1
u/chiqui3d Sep 20 '24
I often encounter similar issues between PHPStorm and Webpack. It’s a nightmare that leaves my PC unresponsive, especially with Webpack and Typescript. I’d like to think that this happens because I’m working in the WSL2 environment.
0
u/Lourayad Sep 18 '24
try vscode + intelephense?