You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Bug: all kind of array(Array, PoolByteArray, PoolStringArray ...) Memory leak when pass to GdNative #318
Godot version:
Godot 3.1.1.stable.official and Godot v3.1.2.devel.custom_build
OS/device including version:
Windows7
Issue description:
Only create a lot of array in GDscript, the memory can be freed.
Only create a lot of array in GDNative(cpp), the memory can be freed.
But create a lot of array and PoolByteArray, PoolStringArray and so on, the memory can not be freed. And If the memory used more than device, the project will memory leak and crash.
For now I use something like this:
# test arrayfunc_on_Button2_pressed():
foriinrange(10000):
vardata= []
forjinrange(1024):
data.push_back(j)
test.test_array(data)
pass# Replace with function body.
@2shady4u OK, Today I clone new code, and this problem still persists. Godot version:
Godot 3.1.1.stable.official and Godot v3.1.2.devel.custom_build and v3.2.alpha.custom_build.a1033aea5
OS/device including version:
Windows7
godot-cpp:
master
How to repeat:
click the button "test array" some times. And you can see the memory rise and will not release.
You can click until you computer memory use up. And the same code in gdscript and no gdnative,
the memory will not rise.
I have try to debug in vs2017, but i just find array ref() is more than unref(). But i don't know how to fix this problem.
Activity
2shady4u commentedon Oct 15, 2019
Heyo,
I ran your test example project and could not replicate these memory leaks.
This might've been fixed in a previous commit.
Could you check if this problem still persists? @zhangshiqian1214
zhangshiqian1214 commentedon Oct 16, 2019
@2shady4u OK, Today I clone new code, and this problem still persists.
Godot version:
Godot 3.1.1.stable.official and Godot v3.1.2.devel.custom_build and v3.2.alpha.custom_build.a1033aea5
OS/device including version:
Windows7
godot-cpp:
master
How to repeat:
click the button "test array" some times. And you can see the memory rise and will not release.
You can click until you computer memory use up. And the same code in gdscript and no gdnative,
the memory will not rise.
I have try to debug in vs2017, but i just find array ref() is more than unref(). But i don't know how to fix this problem.
zhangshiqian1214 commentedon Dec 4, 2019
I use #355 code and test ok, memory will not leak