godotengine / godotengine/godot-docs
Explain Orphan nodes and leaking memory
- Dominant language
- reStructuredText
- Stars
- 5.7k
- Forks
- 3.8k
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 25
Description
Probably a lot of people doesn't know that a game can leaking memory.
The simplest method to check leak is to look at the "Orphan nodes" monitor, which should always show 0, when no leaked instance of node was found.
Also they should know that this message from console is about leaking memory:
```
ERROR: ~List: Condition ' _first != __null ' is true.
At: ./core/self_list.h:111
ERROR: ~List: Condition ' _first != __null ' is true.
At: ./core/self_list.h:111
WARNING: cleanup: ObjectDB Instances still exist!
At: core/object.cpp:2095
```
and it can be easily better described by adding -v to godot run parameters(`godot -e -v`)
```
ERROR: ~List: Condition ' _first != __null ' is true.
At: ./core/self_list.h:111.
ERROR: ~List: Condition ' _first != __null ' is true.
At: ./core/self_list.h:111.
WARNING: cleanup: ObjectDB Instances still exist!
At: core/object.cpp:2098.
Leaked instance: GDScript:1148 - Resource name: Path:
Leaked instance: GDScriptNativeClass:540
Orphan StringName: Reference
Orphan StringName: causes_error
Orphan StringName: new
Orphan StringName: GDScriptNativeClass
Orphan StringName: val
Orphan StringName: res://main_scene.gd
Orphan StringName: from_string
Orphan StringName: input
Orphan StringName: _init
Orphan StringName: GDScript
StringName: 10 unclaimed string names at exit.
```
Also I will add informations, that resources doesn't must be deleted manually because they are removed when last node stops use it.

Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.