# Gladys RAM usage

**URL:** <https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821>\
**Category:** Configuration\
**Created:** [January 7, 2023, 3:26pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821 "2023-01-07T15:26:18Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 10, 2023, 8:33am UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/21 "2023-01-10T08:33:55Z")

</div>

A good test to do if you want to see whether it’s Gladys is simply to stop the Gladys container and see if the RAM usage is still the same

Then, when restarting Gladys, check whether Gladys’s usage has reset or if it immediately goes back up to 12GB.

If it comes back to 100MB, then gradually increases again, it’s probably a memory leak and you’ll need to investigate for longer…

If it’s directly 12GB, we’ll need to understand your setup 🙂

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 10, 2023, 8:49am UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/22 "2023-01-10T08:49:23Z")

</div>

After restarting the container I’m at 2 GB, cruising speed

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 10, 2023, 8:51am UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/23 "2023-01-10T08:51:47Z")

</div>

Ok, now let’s wait and see over the next hours/next days/next weeks if it comes back up.

We’re not immune to a memory leak, it happens 🙂

---

<div class="post-metadata">

**Author:** ![GBoulvin](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/gboulvin/32/10006_2.png) [@GBoulvin](https://community.gladysassistant.com/u/GBoulvin)\
**Post date:** [January 10, 2023, 4:28pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/24 "2023-01-10T16:28:47Z")

</div>

> [@pierre-gilles](#):
>
> We’re not immune to a memory leak, it happens

Is Alzheimer’s lurking for Gladys? 🙃

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 10, 2023, 5:24pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/25 "2023-01-10T17:24:47Z")

</div>

I confirm I’m cruising at 280 MB.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 12, 2023, 5:57pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/26 "2023-01-12T17:57:01Z")

</div>

13 hours after Gladys is at 742 MB  
Less than 48 h : 1 GB  
48 h : 6.81 GB  
I think there’s definitely an issue

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 12, 2023, 6:39pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/27 "2023-01-12T18:39:47Z")

</div>

I’m not seeing the same behavior, 280MB 👀

The main difference I made was updating my packages (Docker was updated)

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 12, 2023, 8:15pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/28 "2023-01-12T20:15:52Z")

</div>

Do you have cameras? If so, what is the refresh rate?

I have 1 million ffmpeg lines at 26.5MB each in the processes with only a single camera that refreshes every 10 seconds

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 12, 2023, 8:32pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/30 "2023-01-12T20:32:00Z")

</div>

yeah I have 2 cams ( refresh 60s )

Not sure it’s normal to have that many streams.

I also have the impression that your Synology is showing you the cache memory as well (if you want to install htop in your container `apk add htop`)

 ![image](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/c/cf4038bfca4dc80021c99511e47990ecd264a9eb.png)

On my side I’m at 300MB real and 2.34GB with the cache.

EDIT: I waited a bit, I see the ffmpeg process spawn (for the refresh) then disappear once the operation is finished, so it’s not normal on your side. I’ll check if my container is increasing in memory.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 12, 2023, 8:43pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/31 "2023-01-12T20:43:25Z")

</div>

Thanks for your help

Here’s my htop, same — quite a few ffmpeg lines

 ![Screenshot_20230112_214202_JuiceSSH](https://gladys-assistant-community.b-cdn.net/uploads/default/original/2X/6/6c87bf6ad188a0abd6557094f2c86094d791e18f.jpeg)

_I didn’t say anything_ I do have 6 GB of physical memory ☹

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 12, 2023, 8:45pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/32 "2023-01-12T20:45:58Z")

</div>

Yeah, the RAM is really being eaten up.

You should try increasing the refresh time and restarting your container.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 12, 2023, 8:48pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/33 "2023-01-12T20:48:08Z")

</div>

What does that mean? 🙂

---

<div class="post-metadata">

**Author:** ![guim31](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/guim31/32/4840_2.png) [@guim31](https://community.gladysassistant.com/u/guim31)\
**Post date:** [January 12, 2023, 9:17pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/34 "2023-01-12T21:17:20Z")

</div>

I think @VonOx means changing the camera’s refresh rate (for example, from 10 sec to 1 min).

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 12, 2023, 9:28pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/35 "2023-01-12T21:28:24Z")

</div>

Okay, I’ll do it

I’ll let you know in about two days  
Currently 206 MB

---

<div class="post-metadata">

**Author:** ![VonOx](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/vonox/32/10128_2.png) [@VonOx](https://community.gladysassistant.com/u/VonOx)\
**Post date:** [January 12, 2023, 9:46pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/36 "2023-01-12T21:46:52Z")

</div>

Exactly, I was talking about the cameras, sorry 🙏

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 12, 2023, 10:46pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/37 "2023-01-12T22:46:50Z")

</div>

No problem, thanks for your time ^^’

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 13, 2023, 12:45am UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/38 "2023-01-13T00:45:40Z")

</div>

Indeed, there seems to be an issue — clearly all those lingering ffmpeg processes are not normal

Is there anything in the logs that could explain why ffmpeg isn’t shutting down?

Normally, on each camera refresh an ffmpeg process is started and then stops once it has the image.

---

<div class="post-metadata">

**Author:** ![spenceur](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/spenceur/32/1961_2.png) [@spenceur](https://community.gladysassistant.com/u/spenceur)\
**Post date:** [January 13, 2023, 9:12am UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/39 "2023-01-13T09:12:51Z")

</div>

I’ll take a look as soon as I have 10 minutes, thanks P-G

@VonOx, @pierre-gilles, FYI, since changing the refresh from 10s to 1min I have over 1 million processes running.  
I’ll keep monitoring but could the problem be coming from that?

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [January 14, 2023, 5:23am UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/40 "2023-01-14T05:23:14Z")

</div>

I don’t think so — you’ve just reduced the problem sixfold, so of course it takes longer to occur 🙂 but the problem is probably still there

---

<div class="post-metadata">

**Author:** ![lmilcent](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/lmilcent/32/7023_2.png) [@lmilcent](https://community.gladysassistant.com/u/lmilcent)\
**Post date:** [January 18, 2023, 3:18pm UTC](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821/41 "2023-01-18T15:18:13Z")

</div>

I confirm I have the same problem (I mention it here: [RSTP Caméra : bug "envoyer par message"](https://community.gladysassistant.com/t/rstp-camera-bug-envoyer-par-message/7856)).

Restarting the Gladys container temporarily «&nbsp;fixes&nbsp;» the RAM issue, but there’s clearly a problem.  
I noticed that the image on the dashboard is updated in **all cases** in the background, even when it isn’t displayed on any device.

→ Maybe we should request the latest image when loading a dashboard rather than all the time in the background?

The other error is that the ffmpeg thread never stops.

[Previous page](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821.md?page=1)

[Next page](https://community.gladysassistant.com/t/gladys-utilisation-de-la-ram/7821.md?page=3)
