SUMMARY Trying tp parse Linux kernel 5.2.1 sources, causes kdevelop process to consume all of the memory. STEPS TO REPRODUCE 1. wget https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.2.1.tar.xz 2. tar xf linux-5.2.1.tar.xz 3. Open a new project in kdevelop from the extracted directory 4. Let the background parser begin parsing OBSERVED RESULT System get's stuck Parser won't finish Memory usage of kdevelop process keeps increasing EXPECTED RESULT Parsed project SOFTWARE/OS VERSIONS Linux/KDE Plasma: Kubuntu 18.04 (available in About System) KDE Plasma Version: 5.12.8 KDE Frameworks Version: 5.44.0 Qt Version: 5.9.5 ADDITIONAL INFORMATION KVM guest 4GB RAM 4 CPUs
Same here with kdevelop-23.04.3, memory usage reached 49 GB before the OOM-killer kicked in. [1570147.196336] [ pid ] uid tgid total_vm rss pgtables_bytes swapents oom_score_adj name [1570147.197206] [ 14374] 1000 14374 12368969 4650241 87040000 5140779 0 kdevelop [1570147.197303] oom-kill:constraint=CONSTRAINT_NONE,nodemask=(null),cpuset=/,mems_allowed=0,global_oom,task_memcg=/,task=kdevelop,pid=14374,uid=1000 [1570147.197352] Out of memory: Killed process 14374 (kdevelop) total-vm:49475876kB, anon-rss:18600964kB, file-rss:0kB, shmem-rss:0kB, UID:1000 pgtables:85000kB oom_score_adj:0 [1570154.066131] oom_reaper: reaped process 14374 (kdevelop), now anon-rss:0kB, file-rss:0kB, shmem-rss:0kB
(In reply to Cyp from comment #1) > Same here with kdevelop-23.04.3, memory usage reached 49 GB before the > OOM-killer kicked in. Restarting KDevelop normally, rather than killing, when it consumes a lot of RAM, should let it keep parsing without loading all the previous parse results into RAM again. This way the parsing should finish after several restarts. That's assuming the huge RAM usage is a consequence of the project's large size, not some leak.
While this should be fixed in KDevelop somehow, it's not necessarily easy to do so. For practical use, I'd recommend configuring a project filter to exclude the drivers/ and arch/ directories. Then, add another filter to specifically only include those things you want to work on. This has little practical effect for most usecases and trims down the project size to something manageable. Alternatively (or additionally), another acceptable choice is to turn off "Schedule all project files for parsing" in the Settings under "Projects". Files and their includes will still be parsed when you open them, so navigation, highlighting, completion etc still work.
Restarting kdevelop without killing often isn't possible, since when quitting, it often ends up with 100% CPU forever in the background until killed. Thanks, unchecking “Settings” (in the top menu bar) → “Configure KDevelop” → “Projects” → “Schedule all project files for parsing” seems to have helped.
*** Bug 475461 has been marked as a duplicate of this bug. ***