I've been using Kate to open binaries and analyze the start and end for specific programming purposes. The files I open, for example, are .mp4s of a few GB. When I open the file, the RAM memory increases in size, but when I close the file, the memory is not released! This greatly affects the program's operation. Is it possible to allocate memory to disk instead of RAM?
We do free memory, so far I know of no large leaks. If you can profile it via heaptrack or valgrind and show a leak, we can take a look. We will not implement own swapping :)
Perhaps we can call malloc trim. Glibc malloc doesn't eagerly return memory to the OS.
(In reply to Waqar Ahmed from comment #2) > Perhaps we can call malloc trim. Glibc malloc doesn't eagerly return memory > to the OS. One can try that, Konsole has some parts that do that.
I can take a look to add that.
I will add it to the application, I don't want to do such stuff in the library, that could regress stuff for other applications using us.
I will take a look.
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/1886
Doing that now after document and project closing.
Git commit dd79fc1bc2f643227b3af53b79fce235ea17c619 by Christoph Cullmann. Committed on 13/09/2025 at 21:23. Pushed by cullmann into branch 'master'. use malloc_trim if available to free memory to the system might avoid too large heap sizes in the long run M +3 -0 addons/project/kateprojectplugin.cpp M +5 -1 apps/lib/CMakeLists.txt M +3 -0 apps/lib/katedocmanager.cpp M +11 -0 apps/lib/ktexteditor_utils.cpp M +6 -0 apps/lib/ktexteditor_utils.h https://invent.kde.org/utilities/kate/-/commit/dd79fc1bc2f643227b3af53b79fce235ea17c619
Perhaps fixed in the next release.