parse-community / parse-community/parse-server

Memory leak when upgrading from Parse Server 6.5.11 to Parse Server 7.5.2

Open
#9,813 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

Hello!

New Issue Checklist
Issue Description

After upgrading from Parse Server 6.5.11 and JS SDK 4.2.0 to Parse Server 7.5.2 and JS SDK 5.3.0, I observed a consistent increase in memory usage over time in our production environment. Heap snapshots revealed that the memory was increasingly filled with what looks like schema related objects, primarily related to the GQL schema.

After adjusting the schemaCacheTtl from 60 to 86400 seconds the memory buildup stopped.

This suggests there might be a memory leak with the GraphQL schema caching in this newer version.

Steps to reproduce

The problem proved difficult to reproduce in a dev environment. I attempted running loads of queries with autocannon locally against the server but saw little increases in memory then. However when it was live in production memory steadily increased every time we released it. I suspect the issue could be bigger in production over dev by the sheer different kinds of requests we're doing, as I only blasted a few different queries in dev.

Here the spike is visible when having this release out between 11.00 and 12.00 with TTL of 60 seconds, and the same release out after 4 pm with the TTL set to 86400.

Image

Actual Outcome

Steady increase of memory usage, primarly filled with schema related objects.

Expected Outcome

Stable memory usage.

Environment

Server

  • Parse Server version: 7.5.2
  • Operating system: Linux
  • Local or remote host: Heroku

Database

  • System (MongoDB or Postgres): MongoDB
  • Database version: 6.0.0
  • Local or remote host: MongoDB Atlas

Client

  • SDK: Javascript
  • SDK version: 5.3.0

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 examining GraphQL schema caching around the schemaCacheTtl setting and compare heap snapshots with TTL values of 60 and 86400 seconds. Try to reproduce the production-like request variety described in the issue, then verify that memory usage remains stable over time and that schema-related objects do not accumulate.

Written by the indexing model from the issue text.

Assessment

Tech stack
graphql, javascript, node.js
Domain
api, backend
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.