Signal-desktop: Memory Leak when switching conversations on 1.40.1, MacOS 11.2.x

Created on 13 Jan 2021  路  11Comments  路  Source: signalapp/Signal-Desktop

  • [x] I have searched open and closed issues for duplicates

Bug Description

Hi,

I noticed Signal App v1.39.4 on Mac Mini, Big Sur 11.1 (20C69), seems to be leaking memory at a fast rate when you switch from one conversation to another.

While writing this, it was around 1.4GB, and now it's up to 1.7GB.

The best way I can reproduce this, is when I switch between the group conversations I have (possibly all chats including individual ones too). I.e., click on the next conversation, and memory climbs up. Then 3rd, climbs again, 4th, etc.. click on 1st again, still climbs even more.

I found a few similar bugs but they're either closed, or on older versions / different platform.

Steps to Reproduce

  1. Click on one conversation
  2. Click on another
  3. Keep doing that.

Actual Result:

Memory leaks around ~10-90MB per iteration.

Expected Result:

Memory to not leak or climb continuously.

Screenshots

Screen Shot 2021-01-13 at 4 40 58 PM
Screen Shot 2021-01-13 at 4 41 04 PM
Screen Shot 2021-01-13 at 4 41 07 PM
Screen Shot 2021-01-13 at 4 47 29 PM
Screen Shot 2021-01-13 at 4 48 10 PM
Screen Shot 2021-01-13 at 5 02 31 PM

-->

Platform Info

Signal Version: v1.39.4

Operating System: Mac Mini 2014, Big Sur 11.1 (20C69)

Linked Device Version: iPhone XS Max, iOS 14.3, running Signal 5.1.0.31

Link to Debug Log

https://debuglogs.org/465d352c490af66a0f09cf278c5e9152cdcee98a35875fe636d05f0f98261114

Edit: up to 1.81GB now.

Let me know if you need anything else. Ta.

Bug

All 11 comments

I see similar behavior on Debian (x86_64) running Signal-Desktop 1.39.4. Does switching conversations also become slow?

I see similar behavior on Debian (x86_64) running Signal-Desktop 1.39.4. Does switching conversations also become slow?

Sluggish, yes.. but it's an old-ish Mac Mini with limited resources anyway ^_^

Thanks for reporting. We'll take a look.

For what it's worth, I've looked into this a few times and was unable to find any obvious culprit. In fact, I noticed memory go back down after the garbage collector ran, which can sometimes take a long time. But I know we have memory leaks somewhere, and this is a helpful lead.

I can see garbage collection in effect mainly with the Steam Helper (Renderer). That climbs up several hundred megs when you're scrolling through the history of a conversation, and eventually drops down (good!).

Edit: I noticed a notification for v1.39.5 so I upgraded & restarted. Signal daemon also still leaks at a slow rate when I switch between conversations. Around 1MB - 50MB per iteration.

Currently sitting at 510MB usage. Edit: 620MB.

Not sure if it helps, but here's a sample from yesterday's around 1.5GB, and now around 520MB.

Sample of Signal v1.39.4.txt
Sample of Signal v1.39.5.txt

If there's anything else I can provide let me know. Hope this helps and thanks for your support!

Tried on Arch and it really goes up when rapidly switching between conversations up to 5-8mb per switch. But after some time the GC kicks in and removes most of it...
I tried recording a memory snapshot with the developer tools and I didn't find anything suspicious in terms of a memory leak...

Good to know!

I have a feeling, either GC isn't kicking in for OSX, or it's not properly doing what it should be doing :/

I hope devs have enough info in this report to narrow down or isolate the issue.

Good to know!

I have a feeling, either GC isn't kicking in for OSX, or it's not properly doing what it should be doing :/

I hope devs have enough info in this report to narrow down or isolate the issue.

Using the App for a day or so and I'm switching conversations but the app always stays ~300-500MB max... I'm not sure if it's a bug only recurring for Mac from the electron side or the Mac side. Definitely needs some more investigation and reports to see if other people have problems too.

Just to confirm, this seems reproducible on an M1 Macbook Air, with 1.40.1.

I had a hunch earlier if maybe this was related to the old conversation version, but I recreated them to the new conversations and still have the same leak.

This happens with both 1-1 and group conversations, when switching between them.

Hi,
I can confirm high memory usage. Big Sur 11.2.3, Apple M1, Signal 1.40.1:
image

I'm also on Big Sur 11.2.3 and seeing high memory utilization >1GB. Mac Mini (Late 2014). Signal v1.40.1
Screen Shot 2021-03-21 at 11 13 55 AM

Also here to confirm high memory use, I'm on Big Sur 11.2.3 - 15-inch MacBook Pro 2017. Signal v.1.40.1.

Screen Shot 2021-03-22 at 9 18 58 am

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cmdrogogov picture cmdrogogov  路  3Comments

jeremymasters picture jeremymasters  路  3Comments

McLoo picture McLoo  路  3Comments

hanzei picture hanzei  路  3Comments

PanderMusubi picture PanderMusubi  路  3Comments