parse-server icon indicating copy to clipboard operation
parse-server copied to clipboard

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

Open Stovedal opened this issue 5 months ago • 2 comments

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

Stovedal avatar Jun 27 '25 15:06 Stovedal

🚀 Thanks for opening this issue!

Maybe you could try some load tests with the different APIs that your app uses. This may help to narrow down the source of it. Otherwise, unfortunately a memory leak is difficult to pinpoint as it may well be your custom code that causes it.

Parse Server 6.5.11 and JS SDK 4.2.0 to Parse Server 7.5.2 and JS SDK 5.3.0

This may help. You could upgrade gradually, version by version, to narrow down the release that introduced this issue for you. The changes between versions could be a starting point to look at. The other thing is that PS 7.5.2 is an outdated version, the issue may well be some dependency or other changes that have already been replaced in PS 8. Your time may be better invested in upgrading to the latest version which may fix the issue, and if it doesn't then you at least did the upgrade.

mtrezza avatar Jul 03 '25 00:07 mtrezza