Memory leak since September update (2022-09 / Bullseye)

I’m using OSMC on a RPi 3B+. I’ve been running 2022-03 for months without issues.

I updated to 2022-09 on 03 Oct. The update went smooth and everything felt OK until today, 17 Oct. The system was unresponsive; I found out that the kodi process held 67% of the main memory. It was impossible to stop the kodi process, so I had to re-power the system.

I have a log of available memory over time, here an excerpt:
750 MB 07/Oct on boot
550 MB 07/Oct Kodi started & idle
520 MB 08/Oct
420 MB 09/Oct
380 MB 10/Oct
370 MB 11/Oct
300 MB 12/Oct
260 MB 13/Oct
220 MB 14/Oct
180 MB 15/Oct
140 MB 16/Oct
100 MB 17/Oct

Roughly speaking, this is 40MB per day. Kodi is mainly used as PVR client (live & recordings). I have a kodi.log of the time range but didn’t find anything useful in it.

This may be an upstream issue, I didn’t research yet, just want to report it here to be able to track it.

To get a better understanding of the problem you are experiencing we need more information from you. The best way to get this information is for you to upload logs that demonstrate your problem. You can learn more about how to submit a useful support request here.

Depending on the used skin you have to set the settings-level to standard or higher, in summary:

  • enable debug logging at settings->system->logging

  • reboot the OSMC device twice(!)

  • reproduce the issue

  • upload the log set (all configs and logs!) either using the Log Uploader method within the My OSMC menu in the GUI or the ssh method invoking command grab-logs -A

  • publish the provided URL from the log set upload, here

Thanks for your understanding. We hope that we can help you get up and running again shortly.

OSMC skin screenshot:

I created a debug log as suggested but do not want to release it in public. May I send it to @Tom_Doyle or someone else via PM?

In addition to the osmc debug log I have another log where the decrease of available memory can be seen. I observed two things:

  1. On 2022-10-26 at 3:20 AM there is a sudden decrease of ~20MB. An update check is running at this time.
  2. On 2022-10-26 between 3:30 AM and 6:00 AM there is a constant decrease, a total of 3 MB for the 2.5h. Log messages in this time:
DEBUG <general>: Thread JobWorker ... terminating (autodelete)


I created a debug log as suggested but do not want to release it in public. May I send it to @Tom_Doyle or someone else via PM?

Yes you can PM. But can I ask why you do not want it be publicly viewable? If its privacy concerns, please check this out first:

Please see the section about Sanitizing logs.

Thanks Tom.


Nothing seems obviously wrong. Do you mind I share the log with the other moderators on this discourse?

In the mean time let’s test with Kodi default settings. Enter the following commands with an SSH connection.

systemctl stop mediacenter
mv ~/.kodi ~/kodi.bak
systemctl start mediacenter

I suspect it may be a addon causing the memory, please try restoring one at a time to see if a culprit can be found.

Thanks Tom.

If needed you can restore:

systemctl stop mediacenter
mv ~/.kodi ~/kodi.bk2
mv ~/kodi.bak ~/.kodi
systemctl start mediacenter

If your original setup was restored as expected and you want get rid of the unneeded clean install you can delete that with the following command.

rm -r ~/kodi.bk2

Do you mind I share the log with the other moderators on this discourse?

I’m fine with that when access to the logs is limited to moderators and/or maintainers.

Thanks for your idea to try a clean kodi profile. I will check it out and post the results here, it may take some time.

My uneducated guess so far: Since memory usage increases even when the system is idle, and the only activity logged in this time is the deletion of worker threads, the behavior may be caused by spawning short-lived threads, could the introduced by the kernel switch with bullseye. I have no evidence for that, the log messages could be completely unrelated, though.

Is the Kodi 19.4 in 2022-09 the same as the Kodi 19.4 in 2022-03?


Could be, trying a clean profile and leaving idle for awhile would help determine this.

Thanks Tom.

Running kodi with a vanilla profile for one night led to constant memory usage, no increase any more. Looks like the leak is caused by something in my profile. That’s great news because it indicates that the problem does not arise from the core of kodi or osmc. In the next step I will try to find out if the leak is caused by a plugin or something else.

1 Like