RocketChat / RocketChat/Rocket.Chat

Memory Leak on Message Sending and/or User/Room Creation

Open
#25,199 8 comments 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

I am migrating a few old messages and chats over to RocketChat via the Rest API from an external server. I am using the Users Create, IM Create and Post Message endpoints to do so.

In the span of two hours, I've created 400 users, 200 rooms and sent about 10-15K messages to these endpoints. The RAM footprint of RocketChat has continuously grown from about 1.2GB to almost 3GB and it comes close to running out of the 4GB we have

CleanShot 2022-04-15 at 11 24 51@2x
Steps to reproduce:
  1. Start a Loop
  2. Create 2 Users
  3. Create a Room
  4. Post some messages to it
  5. See RAM continuously grow
Expected behavior:

This should not happen or at least go back to previous levels after a while.

Actual behavior:

Memory usage continuously grows and can only be returned to previous levels via reboot

CleanShot 2022-04-15 at 11 32 09@2x

Server Setup Information:

Docker

CleanShot 2022-04-15 at 11 34 32@2x
Client Setup Information

Desktop App or Browser Version: Browser, Chrome 99

Additional information
CleanShot 2022-04-15 at 11 52 45@2x

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the loop against the Users Create, IM Create, and Post Message REST API endpoints in the Docker setup, while monitoring RAM usage. Trace the server-side handling of those endpoints to identify what remains retained after repeated user, room, and message creation; done means memory no longer continuously grows under the reported workload.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, typescript
Domain
api, backend, performance
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.