aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/perf/vram.sh
AgeCommit message (Collapse)AuthorFilesLines
3 dayssound: drop the OSD's canvas grain, it broke Qt's garbage collectorDanilo M.1-3/+3
The desktop shell's recurring 100% CPU spin is a Qt bug set off by the volume OSD. Its grain Canvas called createImageData on every paint, and Qt 6.11 subtracts that pixel buffer from the V4 unmanaged-heap counter without having added it. The first GC after an OSD show wrapped the size_t counter, and from then on every JS allocation ran a full GC until a restart. The OSD shows on volume keys, track changes and resume, which is why the spin followed all three. Found by running each always-on unit of the desktop in its own qs with GC stats: only the sound module wrapped, 3 s after a resume, and a volume nudge reproduced it on demand. Qt's qml tool with a bare Canvas confirms it is createImageData alone: 17,856 of 17,856 GCs wrapped, the same canvas drawing with fillRect 0 of 5. With the grain removed, 8 OSD shows under forced GCs left the counter intact. The grain was alpha 14/255, so the OSD looks nearly the same. vram.sh's comment blamed the fdinfo parse for the underflow; corrected, and the lesson is in AGENTS.md. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
5 daysperf: sum VRAM in a shell script instead of in QMLDanilo M.1-0/+54
A process holding thousands of DRM fds makes the fdinfo scan a few hundred KB. Parsing that in QML every 2s drove Qt's unmanaged-heap counter to underflow, after which the V4 engine ran a GC on every allocation and the shell sat at 100% CPU. vram.sh does the scan and the per-client-id sum in awk and prints one number, or nothing when no xe client is found, which the panel draws as a dash. Perf.js loses vram() and its test; test_vram.sh carries the same cases against the script, which takes a file argument instead of scanning so the test can feed it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>