Signal-desktop: Constant ~3GB ram usage

Created on 1 Apr 2017  路  6Comments  路  Source: signalapp/Signal-Desktop

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

Bug description

Around 15 seconds after startup, Signal's memory usage jumps immediately from the normal ~150MB up to just over 3GB.

Steps to reproduce

  • Open Signal Desktop
  • Wait around 15 seconds

Actual result: Uses ~3GB
Expected result: Previously I think it's been under 200MB on startup

Screenshots

image

Platform info

Operating System: Fedora 25, Gnome 3.22.3
Browser: Chromium 56.0.2924.87 Fedora Project (64-bit)
Signal version: 0.34.0

Excerpt from debug log

Debug log isn't particularly useful.

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36 Signal-Desktop/0.34.0

// Open Signal  :10  
2017-04-01T16:51:12.501Z pre-main prep time: 4 ms
2017-04-01T16:51:12.596Z background page reloaded
2017-04-01T16:51:12.670Z extension launched
2017-04-01T16:51:13.087Z opening websocket
2017-04-01T16:51:13.088Z opening message socket https://textsecure-service-ca.whispersystems.org:80
2017-04-01T16:51:13.092Z listening for registration events
2017-04-01T16:51:13.094Z Next signed key rotation scheduled for Mon Apr 03 2017 12:30:24 GMT-0400 (EDT)
2017-04-01T16:51:13.096Z open inbox
2017-04-01T16:51:13.195Z websocket open
2017-04-01T16:51:14.910Z clear attention // Open app monitor to watch for the spike
// Memory spike :26
2017-04-01T16:51:35.098Z clear attention // Return to signal

Maybe or maybe not useful info

  • This is one of two desktop installs linked to the account
  • The device is a relatively infrequently-used laptop

    • I've hit the message queue limit before.

    • I haven't tried doing a reinstall to fix, and am happy to do whatever, to get better logs/diagnose.

  • I've used disappearing messages before. I don't think I've ever deleted a conversation like #1063.
  • Signal does not hang or crash like #962, but maybe that's just because I have 8gb of ram

Most helpful comment

I think I have figured out 4 reasons (so far) why there's such a high memory usage:

  • Sound attachments are loaded into memory before they are played, just with the creation of the conversation view
  • When a conversation gets displayed, all attachments are loaded into ram, not only those, which are visible or in a near scrolling radius.
  • When another conversation view gets displayed, the loaded attachments (audio, images) remain in memory.
  • The image processing and downscaling seems to occupy a whole bunch of memory, which isn't released after the process.

I'm already working on a PR fixing those problems. Stay tuned.

All 6 comments

I have had the same Issue: LinuxMint 18.1, Signal 0.34.0, Chromium 53.0.2785.143
After startup chromium would immediately acquire ~1.5GB RAM.

Yesterday Signal crashed permanently and I had to reinstall, I now have Signal 0.36.1 with an empty database and there is no high memory usage (~200MB). Thus it looks like the problem is either accidentally fixed or it is because of a problem with database access ( The actual data in my message database was far less in size than 1.3GB). I will post an update if the memory usage increases after some amount of data in the DB.

Mine is an old install; it is possible that this is related to database size.

RAM usage is down to around 1GB, which is still much more than I'd expect, but more manageable.

Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2987.133 Safari/537.36 Signal-Desktop/0.39.1

I think I have figured out 4 reasons (so far) why there's such a high memory usage:

  • Sound attachments are loaded into memory before they are played, just with the creation of the conversation view
  • When a conversation gets displayed, all attachments are loaded into ram, not only those, which are visible or in a near scrolling radius.
  • When another conversation view gets displayed, the loaded attachments (audio, images) remain in memory.
  • The image processing and downscaling seems to occupy a whole bunch of memory, which isn't released after the process.

I'm already working on a PR fixing those problems. Stay tuned.

Signal Desktop 0.42.1, released to the Chrome Web Store today, has two changes which may help here. First, it unloads conversations and old messages when they haven't been accessed recently. This should help reduce memory usage over the lifetime of the process. Second, some changes regarding disappearing messages should reduce CPU/memory usage when loading them from the server in bulk on startup.

Let me know if things improve!

On startup, I have 8 chromium-related processes using a combined 590 MB of RAM:

  • chromium-browser.sh uses 350 MB
  • chromium-brower --type=renderer [...] --content-image-target-texture=0,0,3553;[...] --renderer-client-id=4 [...] uses 110 MB

    • I discovered this one is the conversation panel. It jumps up a couple MB when I open a conversation, and by repeatedly scrolling far back in picture-heavy conversations I was able to run it up to 450 MB (but that's not in normal usage).

  • Another renderer with --renderer-client-id=2 uses 60 MB
  • A 3rd renderer with -id=3, two zygotes, a gpu-broker, and a gpu-process use 10-20 MB each.

I also have riot.im saved as a web app; it is closed, but chromium may still run it in the background. I'm pretty sure that would just be a zygote, although who knows, maybe it also contributes to the .sh memory usage.


Overall, while Signal-desktop is still using significantly more memory than I remember in the past, it is now functional enough for me. Feel free to re-open the issue, though, if you're interested in continuing to optimize.

Was this page helpful?
0 / 5 - 0 ratings