-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Element freezes or crashes when too many voice messages are in a chat #26239
Element freezes or crashes when too many voice messages are in a chat #26239
Comments
I can reproduce this. Just upload audio files and record voice messages in a room. Memory usage will grow up fast to several gigabytes. Then it crashes. |
|
Can reproduce on web and desktop. iOS Client not affected. |
Related #19756 |
The white screen is a symptom of Electron, but this would equally happen when running in the browser. Here's a few thoughts on my initial investifation of the problem, An avenue to fix this would be to move the waveform generation to a web worker and potentially add some sort of "max waveform generation" in parralel system. Contributions are of course welcome to fix this issue |
This already is the case https://github.com/matrix-org/matrix-react-sdk/blob/develop/src/workers/playback.worker.ts |
I don't know if it's helpful but I'd like to add: |
The problem is that we are currently loading all files into memory: https://github.com/matrix-org/matrix-react-sdk/blob/491b43ef095f6a174755e9e8977218bfe52b98fa/src/components/views/messages/MAudioBody.tsx#L54
I would say a solution can be to extend |
seems so, but I'm not sure that this was resolved, and to me that issue is critical because I'm not bale to use Element on Desktop. Immediately it is takes all RAM and I'm seeing white background in Element Desktop Window. And I'm forced to remove all voice messages to make it to work. |
Still seems to be happening: I can produce a consistent OOM hang of element-desktop by scrolling up to a part of chat history where someone quoted a series of uploaded audio files in quick succession. Memory usage spikes to 6.1GB (out of my computer's 8GB of RAM, and compared to a "normal" of around 100-300MB) and the chat view starts lagging as I do anything (scrolling, swapping rooms etc.) a couple seconds after seeing the quoted audio files. After about 5 to 10 seconds of the stuttering state, Element starts showing only a blank white screen and becomes unresponsive. Element did drop the excessive RAM usage in the unresponsive state after about a minute, but remained unresponsive for about five minutes before I decided it probably wasn't going to recover and killed it. |
Believe me, physical RAM is not the issue. It still crashes even with 128GB
and I 100% don't have 128GB of voice messages.
…On Sun, Apr 7, 2024 at 7:05 PM Marten Kähr ***@***.***> wrote:
Still seems to be happening: I can produce a consistent OOM crash of
element-desktop by scrolling up to a part of chat history where someone
quoted a series of uploaded audio files in quick succession. Memory usage
spikes to 6.1GB (out of my computer's 8GB of RAM, and compared to a
"normal" of around 100-300MB) and the chat view starts lagging as I do
anything (scrolling, swapping rooms etc.) a couple seconds after seeing the
quoted audio files. After about 5 to 10 seconds of the stuttering state,
Element starts showing only a blank white screen and becomes unresponsive.
Element did drop the excessive RAM usage in the unresponsive state after
about a minute, but remained unresponsive for about five minutes before I
decided it probably wasn't going to recover and killed it.
—
Reply to this email directly, view it on GitHub
<#26239 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGMXXMUWRQ65NNJSU3C3DKLY4ED65AVCNFSM6AAAAAA5HRX3I6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBRGM3TQMJUGE>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Oh, definitely not. There's no way five or six sub-10-minute mp3 files are 6GB either. Something about audio uploads in quick succession (whether they're voice messages or something else) causes Element to fill all memory it can grab with... something it fails to use or release, and crash when the system inevitably stops giving it more. That said, I've done a bit more testing. I've let it stay on the unresponsive whitescreen for a good 30 minutes, and it's safe to say element doesn't recover gracefully from whatever happens here, even if it does release the crazy peak memory allocation pretty quickly after hanging. I've also managed to capture this during the peak of memory usage: Whatever it's doing, it's clearly trying to allocate a downright unreasonable amount of RAM for whatever it's trying (and failing) to do when it encounters that part of room history with the quoted audio uploads. If anyone has suggestions for any useful testing/logging I'm not an advanced enough of a user to think of on my own, let me know and I'll try and do it, since I can reproduce the issue on demand just by scrolling up in a particular room. |
Same issue for me, 2 years of voice message history has about 3gb in size. I have exactly the same behavior as described here, but it works in the WebBrowser version of Element. Other Matrix Clients are unaffected. |
Here we go! |
YES THAT WORKS! YEEEEEEEEHHHHHHHHHHAAAAAAAA!!!!!!!!!!!!!!!!!!!!!!!! |
It looks like 1.11.67 does fix the issue. |
Desktop client still stutters and tries to hog a whole lot of memory (see behavior in the memory maps picture from my Apr 7 post; still happening, but stops at 32GiB) when a lot of audio files in quick succession are uploaded, but the client doesn't soft-crash into a broken state anymore. |
This is still a problem |
Steps to reproduce
Outcome
What did you expect?
The chat should be responsive and render only voice messages that are on-screen
What happened instead?
Slow chat loading and an app crash
Operating system
macOS (13.4 Macbook Air M2)
Application version
Element version: 1.11.34 Olm version: 3.2.14
How did you install the app?
Element Website
Homeserver
Synapse 1.86.0
Will you send logs?
Yes
The text was updated successfully, but these errors were encountered: