Please test with those builds, hopefully they'lll help to narrow it down a bit:
RPi4: https://www.horus.com/~hias/tmp/libr…455-ddbb512.tar
RPi5: https://www.horus.com/~hias/tmp/libr…425-ddbb512.tar
They are current LE12 builds and have kodi compiled with debug info plus the leak sanitizer enabled (for the self builders: include the top 2 commits from this branch https://github.com/HiassofT/Libre…le12-sanitizers and build with DEBUG=kodi)
After stopping kodi (systemctl stop kodi) the sanitizer will output detailled info about leaked memory. For now look at the summary (run systemctl status kodi | grep SUMMARY after stopping kodi).
First stop kodi pretty immediately after startup to get a baseline. Here on RPi5 I see about 900k leaked in a bit over 2k allocations:
Aug 03 12:25:43 LibreELEC kodi.sh[1097]: SUMMARY: LeakSanitizer: 936782 byte(s) leaked in 2027 allocation(s).
Then reboot, let kodi run for some time until you see increased kodi memory usage / less free memory, stop kodi and check the summary again.
Please report the values you got for baseline and in the "increased memory" case.
Here in local tests (just letting kodi idle on the main screen) I couldn't see much difference between 30s, 6min and 15min running time.
After 6min I got
Aug 03 12:22:33 LibreELEC kodi.sh[980]: SUMMARY: LeakSanitizer: 920304 byte(s) leaked in 2030 allocation(s).
And after 15min I got
Aug 03 13:03:04 LibreELEC kodi.sh[1198]: SUMMARY: LeakSanitizer: 920296 byte(s) leaked in 2029 allocation(s).
Hopefully your tests will show significantly more leaked memory, then we can start looking further into the actual allocations.
so long,
Hias