enigma2 icon indicating copy to clipboard operation
enigma2 copied to clipboard

Data update requested by Kodi or DreamPlayer causes memory leak of /usr/bin/enigma2 process

Open ProTofik opened this issue 1 year ago • 12 comments

Hello,

I have a problem with memory leak of /usr/bin/enigma2 crashing my receiver.

Describe the bug / Actual behaviour: Every time a client such as Kodi with PVR plugin or Android TV/Fire TV app called DreamPlayer makes data request to my OpenATV receiver, the memory usage of the process /usr/bin/engima2 increases slightly. Eventually after a few days the receiver stops responding and needs to be rebooted.

Have a look at the screenshots below. I am monitoring my receiver using net-snmp-server plugin and LibreNMS.

Here is the screenshot of physical memory usage:

Image

And here is the screenshot of network usage:

Image

On the combined graph below, you can see that the memory usage increase happens every 2 hours, at exactly the same time as my clients are making data update queries:

Image

Using ps or htop, I can see the memory usage of /usr/bin/enigma2 increasing every time a request is made by one of my clients.

Image

This eventually leads to the receiver crashing once it runs out of available RAM.

Expected behaviour: /usr/bin/enigma2 process should free up the RAM once it is done providing requested data to remote clients.

Has this issue started to happen just recently? It started a few months ago when I added 2 more remote clients to my household. I only got around to properly trace the root cause of the problem today though.

To reproduce: Steps to reproduce the behavior:

On the receiver:

  1. Flash OpenATV 7.5.1.20250218 image onto Zgemma H9 TWIN receiver
  2. Install OSCam 2.25.01-11868-802 plugin
  3. Upload bouquets to the receiver

On a client of your choice such as Kodi with PVR plugin, or DreamPlayer installed on Android TV or FireTV:

  1. Point the client app of your choice to the IPv4 address of the OpenATV receiver
  2. Wait for it to sync channels, picons, EPG, and so on, or force the update

Back on the receiver:

  1. Observe memory usage of /usr/bin/enigma2 increasing and not dropping back down to its previous level as the update completes.

Image/Box Model (please complete the following information):

  • Version: OpenATV 7.5.1.20250218 (2025-02-18)
  • BoxModel: Zgemma H9 TWIN

Additional context Just for clarity, over the past few months I have reflashed my Zgemma receiver multiple times and kept the config as bare-bone as possible to isolate this issue.

ProTofik avatar Feb 19 '25 21:02 ProTofik

I have the same problem.

vogofox avatar Mar 14 '25 19:03 vogofox

It has been a month since I reported this bug with no comment from any dev. Is this project still being monitored?

ProTofik avatar Mar 19 '25 11:03 ProTofik

I've made some fine-tuning adjustments to the Enigma2 plugin in my Kodi instance. Specifically, I've increased the Update Interval in the Settings - Enigma2 Client - General section from the default value to 30 minutes.

This change has resulted in a reduction in the memory leak. I've attached a picture for your reference.

Image

vogofox avatar Mar 19 '25 12:03 vogofox

@vogofox Well it doesn't change the fact that the memory leak still occurs.

I am currently working around this problem by having set a cronjob that reboots the receiver once a day in the middle of the night but that is a workaround, not a solution.

ProTofik avatar Mar 19 '25 12:03 ProTofik

OpenATV and all other images are maintained by users in their private free time and we all get no money.

Your problem is very difficult to investigate. You don’t need a cron job because there is a feature called scheduler formally known as power timer to reboot or shut down your box daily.

jbleyel avatar Mar 19 '25 22:03 jbleyel

I fully appreciate the effort that goes into maintaining free open source software.

All I was saying is that I took time and effort to diagnose and pinpoint the issue so a simple acknowledgement of the bug would be nice, especially given I have provided clear and easy to reproduce steps.

ProTofik avatar Mar 20 '25 20:03 ProTofik

The problem is not that easy to reproduce because I don’t use Kodi and I don’t connect from one box to another.

It looks like the that the Kodi Plugin use the webinterface / openwebif to fetch data from the box. Each of these api requests should not create any leak but it seams there is one.

The first step of the investigation must be: Don’t use the Kodi Plugin and try to reproduce the leak by calling one api call and then the next and so one until we have the bad one.

jbleyel avatar Mar 20 '25 22:03 jbleyel

I am running LibreElec on RaspberryPi 4 however Kodi can be installed as an application on any Windows computer. Another option is to get DreamPlayer app on an Android device.

I am not familiar with doing individual API calls, if you give me instructions on how to do it I can give it a try and report back.

ProTofik avatar Mar 20 '25 22:03 ProTofik

You can find the api calls in the enigma debug log. I don’t have any Android or Windows device. Maybe someone else can help here.

jbleyel avatar Mar 21 '25 07:03 jbleyel

I'll take care of the API tests and figure out which call is causing the leak. I'll have some time in the next two weeks to do this and get back to you with the results.

vogofox avatar Mar 21 '25 07:03 vogofox

Do you have any update?

jbleyel avatar May 10 '25 05:05 jbleyel

he is running kodi on raspbery with libreelec not on stb the enigma2 addon in kodi does not work fine it's based on vti many functions for asking ber signal etc does not work on oe-a

luisteraar avatar May 10 '25 08:05 luisteraar