Version: 4.0.0 (using KDE 4.4.2) OS: Linux When I created a project and opened one of the source files, KDevelop started parsing everything. At 20%, it was using 5GB of memory (according to "top"), and 2.2GB of it was resident. I have 4GB of RAM, so my computer pretty much froze at this point. The background parser should be a bit smarter about its memory usage. Reproducible: Didn't try Steps to Reproduce: Open a project with lots of files. Actual Results: KDevelop uses up all memory, causing everything to freeze. Expected Results: KDevelop should either use less memory, or give up parsing after a while.
Can you provide the project? If not, there is nothing we can do about it since we cannot reproduce it. I use kdevelop with lots of projects, some of them are actually quite big (kate, kdevelop, kdelibs) and I still have no problems with 4 GB of ram. Also note: we have a known problem with memory fragmentation that's already tracked somewhere. If you parse a project and let it write the cache, then reopen KDevelop it should have a "smaller" memory consumption.
I can reproduce on a computer with 4 GB of RAM using KDevelop 5.0.3 from the Fedora repository. Typical resident memory usage for KDevelop with the background parser is around 2.2 GB. I work on Mixxx which is a large C++ project. I have written instructions for setting up KDevelop to work on this project: http://mixxx.org/wiki/doku.php/kdevelop Before I turned on a swap partition KDevelop was unusable for me (sometimes Linux's out of memory killer kicked in). With a swap partition, it still slows down my system a lot; I cannot work with KDevelop, Firefox, Thunderbird, and Mixxx open simultaneously, let alone build Mixxx with all those open.
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information as soon as possible and set the bug status as REPORTED. Due to regular bug tracker maintenance, if the bug is still in NEEDSINFO status with no change in 30 days, the bug will be closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging If you have already provided the requested information, please set the bug status as REPORTED so that the KDE team knows that the bug is ready to be confirmed. Thank you for helping us make KDE software even better for everyone!
Dear Bug Submitter, This bug has been in NEEDSINFO status with no change for at least 30 days. The bug is now closed as RESOLVED > WORKSFORME due to lack of needed information. For more information about our bug triaging procedures please read the wiki located here: https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging Thank you for helping us make KDE software even better for everyone!
I provided the requested information but there was no a response before this bug expired.
I also suffer from this problem. For me KDevelop often uses so much memory that my PC stops responding. In fact I just had this issue. When I started up KDevelop after restarting my PC it asked if I wanted to clear the cache so I said yes. Shortly afterwards my PC started running slowly so I checked System Monitor and saw that KDevelop was using 4GiB of RAM for its initial parsing!! This is a major issue for me since my laptop only has 7.7GiB. It is normal for me to have KDevelop, Firefox, KMail, NeoChat all open whilst compiling at the same time and unfortunately I can no longer use KDevelop because of this. KDevelop version is 5.12.230802 and the project I usually work on is Elisa: https://invent.kde.org/multimedia/elisa/
Several ways to work around high memory usage are suggested in comments to Bug 410455.
(In reply to Jack Hill from comment #6) > I also suffer from this problem. For me KDevelop often uses so much memory > that my PC stops responding. > > This is a major issue for me since my laptop only has 7.7GiB. It is normal > for me to have KDevelop, Firefox, KMail, NeoChat all open whilst compiling > at the same time and unfortunately I can no longer use KDevelop because of > this. 8 GB of is a very low amount of RAM for a modern development setup. I had been hit by this issue hard before, because my computer has only 16 GB of RAM. Following guides like https://wiki.archlinux.org/title/Swap#Performance, I set vm.swappiness=1 and vm.vfs_cache_pressure=50 in /etc/sysctl.d/99-sysctl.conf, which made the slowdown very sudden and intense when my system run out of RAM. My current solution is to put the highest-priority swap partition on an SSD. This way, when RAM is exhausted, the slowdown is not nearly as extreme as when swapping to an HDD. Increasing vm.swappiness can make the RAM-exhaustion slowdown much more gradual even without an SSD, at the cost of negative impact on normal performance. Apart from restarting KDevelop when it consumes a lot of RAM, another way to reduce RAM usage is to set KDevelop's or KDevelop-libclang's temporary directory to a location on disk rather than in /tmp (which is usually on a tmpfs). That's because libclang writes large files named preamble-*.pch into the temporary directory. You can set one of the temporary directory environment variables supported by libclang (see https://github.com/llvm/llvm-project/blob/b6b492880f5ac6357d85ba2f3ad8e41fded1d97c/llvm/lib/Support/Unix/Path.inc#L1435 for Unix-like systems). For example, run KDevelop as `TEMPDIR=/path/to/an/hdd/dir kdevelop`. Starting with LLVM 17, you'd also have to configure KDevelop not to place the preamble files into RAM (see the screenshots in https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/283).
*** Bug 487255 has been marked as a duplicate of this bug. ***