Skip to content

Godot leaking massive memory just by itself #82769

@Sighan

Description

@Sighan

Godot version

4.1.1 stable

System information

macOS Montery 12.5.1, 16GB RAM, Forward+ Renderer

Issue description

When running a project from godot (pressing the play button), the new window will just keep leaking memory, regardless of project size.

The Tests:
I set up a new project, added a scene and tested the following:

  • Just a single Node as the scene root, nothing else
  • Just a single Node2D as the scene root, nothing else
  • Node as Scene Root, then 20 Node2Ds as children
  • Node as scene root, then 20 Node2Ds with processing disabled as children
  • Finally another run with just a node, to see if it would yield different results as the first run with a single node (it did)

While running the tests I didn't do anything else, just kept the Godot window open in the background.

The Results:
data

I tested every configuration for at least 2 hours, some longer (except for the last one, ran out of time)

As you can see even just an empty scene in an empty project will keep growing in memory usage, my guess is indefinetly. Notably the last test (with an empty scene, containing just an empty Node) grew the fastest. Likewise the tests with 20 Node2Ds yielded similar resuts, regardless of processing being turned on or of. This leads me to believe that godot itself is leaking memory, not the nodes.

I will also attach all screenshots I took during those tests, showing my activity monitor (which is apples task manager). You can see how the memory usage changed over time. I tried to take a screenshot about every 30 minutes.

Single Node:

node-01
node-02
node-03
node-04
node-05
node-06

Single Node2D:

node2d-1
node2d-2
node2d-3
node2d-4
node2d-5
node2d-6
node2d-07
node2d-08
node2d-09
node2d-10

20 Node2Ds:

20node2ds-01
20node2ds-02
20node2ds-03
20node2ds-04
20node2ds-05

20 Node2Ds with processing turned off:

20node2ds-no-processing-01
20node2ds-no-processing-02
20node2ds-no-processing-03
20node2ds-no-processing-04
20node2ds-no-processing-05

Single Node (again after all other tests)

single-node-finale-01
single-node-finale-02
single-node-finale-03
single-node-finale-04

Steps to reproduce

Create an empty project. Create an empty scene. Run that project. Observe memory usage growing.

Minimal reproduction project

empty-game.zip

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions