Skip to content
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

we have a memory leak somewhere #10890

Closed
turt2live opened this issue Sep 17, 2019 · 13 comments
Closed

we have a memory leak somewhere #10890

turt2live opened this issue Sep 17, 2019 · 13 comments
Assignees
Labels
A-Memory Memory leaks, leak hunting tools X-Blocked

Comments

@turt2live
Copy link
Member

My riot tab gets to 3.5gb before noticeable slowness. Takes 24h or so to get there. This is recent - am looking into it

@richvdh
Copy link
Member

richvdh commented Sep 17, 2019

+1. I've noticed an uptick in tab crashes in recent weeks.

@turt2live turt2live self-assigned this Sep 17, 2019
@turt2live
Copy link
Member Author

looks like ~18% of the tab's memory pre-crash is spent storing my own custom status. Comparing to a "normal" usage snapshot, only ~8% is used for custom status. Something seems to duplicate objects in there, somehow.

Also MegolmEncryption is a very heavy class, topping the charts in both the normal and pre-crash snapshots. Both at the same value though.

More investigation needed.

@turt2live
Copy link
Member Author

Blocked on more data - custom status seems to be the fault for me, but I have a hard time believing that is the case for everyone affected by this.

@tuxayo
Copy link
Contributor

tuxayo commented Oct 2, 2019

Edit: Now there is a documentation page: https://github.com/vector-im/riot-web/blob/develop/docs/memory-profiles-and-leaks.md

Instructions for getting a memory profile, source + some changes : https://matrix.to/#/!DdJkzRliezrwpNebLk:matrix.org/$15698610401101qMXQV:t2l.io?via=matrix.org&via=taylorbuchanan.com&via=t2l.io

Firefox:

  1. CTRL+SHIFT+I (I as in eye, again)
  2. Click the Memory tab
  3. Press the camera icon in the top left of the dev tools window
  4. Wait a bit (suggest coffee)
  5. When the save button appears in the left sidebar, click it and save it locally.
  6. Send the file (optionally gzipped) to someone over a safe medium (it can contain your access token, though it shouldn't)

Note that with Firefox the tab might be inoperable during the process above.

Chromium/Chrome:

  1. Press CTRL+SHIFT+I (I as in eye)
  2. Go to the Memory tab
  3. Select "Heap snapshot" and the riot.im VM instance
  4. Click "Take Snapshot"
  5. Make some coffee and wait.
  6. After the profile is taken, there should be a save button on the left sidebar. Click that and save it to your hard drive somewhere.
  7. Send the file (optionally gzipped) to someone over a safe medium (it can contain your access token, though it shouldn't)

Note that with Chorimum/Chrome the tab might be inoperable during the process above.

If you start catching the tab spontaneously freezing as you click around and type messages, grab a snapshot - there's a good chance it is about to crash on you.
A "normal" usage snapshot (~30-60min after reloading the page) and just before crash are the most helpful.

@Half-Shot
Copy link
Member

Checking in to say I will get a white screen of death at least once a day, which I believe is due to memory consumption issues.

@turt2live
Copy link
Member Author

@Half-Shot please get memory profiles so we can figure out what is going on. One of "normal" (about 30-60 minutes after startup) and one of just before crash (ie: the 23rd hour before crash). See https://github.com/vector-im/riot-web/blob/develop/docs/memory-profiles-and-leaks.md for more info

@Half-Shot
Copy link
Member

Kk, will do.

@dbkr
Copy link
Member

dbkr commented Oct 18, 2019

I've just noticed my riot-web had accumulated a lot of memory and snapshotted it. There was an awful lot of stuff retained by velocity so I suspect this has regressed again. Rather than taping it back up again I suggest we kill velocity as native CSS animations must be non-terrible by now.

@turt2live
Copy link
Member Author

I also have a backlog of community profiles to look at, but am hoping to find a trend somewhere.

It sounds like we should kill velocity independently of bugs it might have.

@jryans
Copy link
Collaborator

jryans commented Jan 16, 2020

If you do happen to have the custom status lab enabled, a leak in that feature was just fixed on develop.

@jryans
Copy link
Collaborator

jryans commented May 1, 2020

@turt2live Is this general meta-issue useful to keep open? Are you still noticing memory issues?

@turt2live
Copy link
Member Author

We still do have a memory leak, though not as severe as when reported. I'm not currently looking at it though

@turt2live
Copy link
Member Author

I think we fixed this by accident.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Memory Memory leaks, leak hunting tools X-Blocked
Projects
None yet
Development

No branches or pull requests

6 participants