The Signal app uses more than 1Gb of RAM on my OnePlus 3 on average (currently it is using 1.3Gb)
0) Have a Oneplus 3 (A3003)
1) flash NLOS 16 (Lineage OS derivative), see https://forum.xda-developers.com/oneplus-3/oneplus-3--3t-cross-device-development/rom-nlos-16-0-t3879405
2) Do not flash google apps
3) Install signal via the apk on the website.
4) check RAM consumption
Clean flash of this ROM makes no difference.
Actual result: High RAM usage (>1 Gb)
Expected result: ~30 Mb (that's what my friend's mobile using google play services use, I expect slightly more RAM usage in my case.)
Device: ONEPLUS A3003
Android version: 9
Signal version: 4.50.5
https://debuglogs.org/c64f04ba34f0874dcb5a26590477093a7fa5b1b269ef16adbe9d0b541875d8f0
Hi,
I have the same problem running Signal 4.50.5 on GrapheneOS without Play Services.
RAM consumption is very high and after one week I need to reboot the phone because everything is stuck.
Debuglogs are here: https://debuglogs.org/5905584d5b2973fbf35ab14fad2ac64b84c73bca2208f412382eca4a7d4013c9
Thanks for investigating this issue.
On the signal website, the listed apk version to download is 4.50.5. Using the Aurora store (FOSS google play frontend) I downloaded and tried 4.51.6. Unfortunately right now my RAM consumption is 870Mb (still seems rather high, for one groupchaten 4 active other chats with a few messages a day)
https://debuglogs.org/a1ae95e1ac1c71af3d6ad6550f0b7d961c0df1e34ce21c10aeeafe56ccc3576c
2 days later the RAM is almost exhausted.
https://debuglogs.org/296affda959ace425cea99e94987bfeed2c4e7e5a559708891c3a91b26ee51f9
Have you folks check the integrity of the app ?
Currently experiencing the same issue, with lower, but similarly high RAM usage.
I'm running LineageOS 16.0 (GSI, custom build) on a Galaxy A3 2017 without any google services (nor OpenGapps nor MicroG).
Signal was installed from the site (through a F-Droid repo)
I've been having the same issue for a couple of weeks now. I don't have RAM numbers right now, as I just had to restart my phone again. I am running a stock OS with Google Play Services, but I have a LOT of things disabled via adb. Let me know if I can provide any more info. LG V40 on Sprint.
Maybe this is related:
I have a Samsung Galaxy M10s, which has 3GB of RAM. It's running stock ROM whatever come preinstalled with phone. No rooting, no custom ROM. Even I am having the same issue(up to 1.4GB Ram usage in under 60hours). I have to clear the app manually. Honestly I couldn't find the reason myself but found this thread. I am posting here to increase this issue's visibility.
It would be interesting to know if a developer has already looked at it. The bug is already present for a few months.
Interesting. I'd be curious what types of things you're doing in Signal. For instance, if you're sending/recording a lot of video. There's not a ton of thing that we could do to shoot up our RAM usage.
But just in general, no one should need to be concerned about the RAM usage of any app on their phone. If you're using another app and it needs more memory, the system will evict Signal from memory if it feels like it needs to. You shouldn't be hitting performance problems.
Hi, thanks for your reply.
Well, my Signal usage basically only consists of writing "normal" messages. I send/receive one video per month on average and I do one voice call per month on average. But that's it.
Regarding the performance problems: Well, the situation is (at least with my phone) as I described it. Within one week after the last phone reboot the phone is stuck again and freezes because Signal uses all the RAM (and apparently doesn't release it).
I don't know for sure, but it happened to me now when I sent the same picture to more than one contact (about 3 contacts). Maybe this helps?
I just spoke with some friends who have the same setup like me. Pixel 3a, GrapheneOS (no play services) and Signal website distribution build. All of them have the same problem with this high RAM usage. One of them already had 1,9 GB RAM usage 33 hours since the process started.
Same problem with Pixel 2, GrapheneOS without Play Services with 4.58.5 from Play Store Beta Channel.
RAM is often nearly full (4GB in total), swapping doesn't really work @greyson-signal , e.g. Fennec can most of the time only hold one or two tabs active. This was definetely better before installing Signal.
Total used disk space of Signal is 206,1MB. Using it everyday, mostly sending messages and sometimes send and receive images. What can we do to help with this issue? It is really critical in my opinion.
I also think, that this issue is getting worse. I have to force kill the app every few hours.
We really need to fix this asap.
Anything we can do?
I'm wondering why the signal-devs don't encounter the same problem as well. For sure they must have some test devices without play services installed.
I talked to 5 people now which have this setup (AOSP-based ROM, no play services, signal website build) and all of them need to kill signal / reboot phone every few days because of this bug.
If we can help with more information to debug, please let us know.
https://github.com/signalapp/Signal-Android/pull/9221
Possible fix?
But just in general, no one should need to be concerned about the RAM usage of any app on their phone. If you're using another app and it needs more memory, the system will evict Signal from memory if it feels like it needs to. You shouldn't be hitting performance problems.
Doesn't seem so....
but nobody cares anyway...
Ok wow.
It's really annoying to force kill Signal every few days. Can a developer get into this, PLEASE?
Really don't want to switch back to WhatsSh*t...
I have a workaround for the next 2 years, until it gets fixed, but you need root access.
Install the FOSS-App "Easer". Create a profile and run these 3 seperate commands:
am force-stop org.thoughtcrime.securesms
am start -n org.thoughtcrime.securesms/org.thoughtcrime.securesms.MainActivity
input keyevent 3
Ensure that you enabled root in the Easer settings. I run this profile every 2 hours. Hope it helps someone.
Tried again... but... Serious? Average 1.8 GB RAM usage...
9221
Possible fix?
FYI:
I just forked Signal and merged that PR. This does not fix the problem - it just takes longer until it starts lagging. So, I guess it's related to missing Play Services.
I just forked Signal and merged that PR. This does not fix the problem - it just takes longer until it starts lagging. So, I guess it's related to missing Play Services.
I was having the same problem with my stock/non-rooted Galaxy M10s. I've play services installed.
My previous comment ITT: https://github.com/signalapp/Signal-Android/issues/9251#issuecomment-574233720
I've worked extensively on Android devices without Play Services, so I am going to have a look at this. I have some ideas...
There's really only one thing in the Signal-Android codebase I've found that is related to Play Services - the UpdateApkRefreshListener and UpdateApkJob. I wonder if something isn't cleaned up after the periodic job runs - based on a quick look-over, it runs every six hours. Seems like the kind of thing that would cause a problem over a period of several days.
I'll let it run overnight and see what the memory profile has to say.
We're back! And, uh, my Android Studio is pretty sluggish this morning.
This memory profile is...not good. Memory usage roughly doubled from 64MB to about 128MB overnight, which is definitely not what you want to see. I started this test around midnight, and am revisiting at approximately 10AM.
Methodology: Apart from modifying gradle versions, I made a single modification to the webDebug build variant. I modified the UpdateApkJob to run every few minutes instead of every six hours, and, well...
In order to confirm this theory is true and that I didn't mess something up, I am going to modify the code again so the UpdateApkJob does not run at all for a day.
I will note, however, that this effectively squeezes multiple days' work of ApkUpdates into a night, and this test did not show the enormous consumption of memory that others have seen. That being said, this is an emulator and not a true device, and the memory settings are of course different, etc. etc. Just to temper expectations.
So...I ran this all day today, and yet again my emulator was brought to its knees.
@greyson-signal, I see you added FrameRateTracker in early December. This ArrayList capturing the FPS data becomes quite large when I'm running this thing all day. I don't know if this is an emulator-only deal or something that is also on prod, but could you comment on whether or not it needs to be capped or fixed? Not sure what your intent here was.
Also from the above data, you can see that LRUCache/JobTracker/UpdateApkJob (our friend!) are retaining a lot of unnecessary data. It appears that UpdateApkJobs are not cleaned up after they're run. I'm looking to investigate why that might be.
Ninja edit: To clarify, LRUCache/JobTracker/UpdateApkJob are all linked.
Ran the emulator again overnight.
I decreased the size of LRUCache from 1000 to 100, and turned off FrameRateTracker, and the issue appears to be all fixed.
Really, I think FrameRateTracker is the culprit here - the LRUCache just caches the last 1000 "Jobs", which shouldn't be a problem under normal operation. I misinterpreted its purpose before.
@EukalyptusX - if you have the ability to make your own builds, could you give me a hand and test out a fix on your HW? I have google play on my pixel2, and I don't want to toss up a commit for something that's only been tested in an emulator.
All you should have to do is comment out
ApplicationDependencies.getFrameRateTracker().begin();
and
ApplicationDependencies.getFrameRateTracker().end();
within ApplicationContext.java.
Thank you so much for your help!
I'll build this asap - hopefully tonight. I'll let you know.
Ok, just finished the build. I'll report back asap (until weekend I guess).
Thank you again for your help!
I can confirm, this works!! Usually I'd already have about 500MB RAM used by Signal. Max. is now definetly lower!
Thank you so much!
@greyson-signal
Lol...Now it says it didn't use ANY ram in the last 3 hours 馃槀 Is that even possible?
Glad to hear it! Do you keep signal active all the time? In the background all the time? Or do you close it when you are not using it?
Glad to hear it! Do you keep signal active all the time? In the background all the time? Or do you close it when you are not using it?
Yes, it's always active - I can see the Signal icon in the taskbar, too (see attached screenshot). I also get notifications. I'm not closing the app. I just press the menu button.
Do you know what the purpose of the FrameRateTraacker is?
Okay, that is helpful!
Basically the problem is that the FrameRateTracker adds the framerate once per second to an arraylist, and that arraylist has no upper bound. It really needs to be a data structure with a max size. I will revisit when I have time early next week - but regardless this needs @greyson-signal to weigh in since it's his code. I think the purpose was to make performance issues easier to spot, since framerate drops could easily be correlated with logs.
I'm sure you see the irony.
Potentially resolved by @alan-signal at 3741493cb733eb8bfbe944a8a195ddaf596e259b. Thanks Alan (maybe!)!
Hey @mottsauce523! Yes, Alan saw this thread an implemented that fix. Let us know if that resolves this issue. Thanks for your investigation!
Thanks Greyson, much appreciated!
Thanks everybody. RAM consumption got much better. Phone is running for a week now without rebooting, and Signal only consumes 870 MB.
Back again... Great.... not...
That's not even funny...
The issue still exists. Gonna fork again with this "analytics" stuff deactivated.
Guys PLEASE fix this issue which is open for almost a year!!!
@greyson-signal
Tested again. Issue still exists.
Wow.
Most helpful comment
That's not even funny...
The issue still exists. Gonna fork again with this "analytics" stuff deactivated.
Guys PLEASE fix this issue which is open for almost a year!!!
@greyson-signal