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
Operating system or device - Godot version:
Godot 2.1.3.
Win 7 32 bit.
3,39 gb RAM usable
I don´t know if an array with 30.000.000 of "0" should freeze Godot, if this is normal I close the issue.
Issue description:
Push back an array with a value of "0" , 10 million times is ok
Push back an array with a value of "0", 30 million times throw:
Vector::push_back: condition 'err' is true. returned: true
Vector::resize: condition '!_ptrnew' is true. returned: ERR_OUT_OF_MEMORY
...And throw this error in loop freezing the program.
If I put other loop before, the freeze is with less iterations.
You can freeze godot with other kind of iterations (above 20.000.000 or 30.000.000 times)
without append nothing to dict or array.
Steps to reproduce:
Use the next code with 10 millions of iterations and 30 millions of iterations.
Link to minimal example project:
extends Node2D
const iterationsnumber = 30000000
func _ready():
var arraywhile = Array()
var counter = 0
var timestamp = OS.get_ticks_msec()
while (counter < iterationsnumber):
arraywhile.append(0)
counter +=1
var timestampEnd = OS.get_ticks_msec()
time = timestampEnd - timestamp
print ("While loop append to array "+ str(iterationsnumber) +" iterations and int add \"[0]\" Ticks:
"+str(time))
The text was updated successfully, but these errors were encountered:
Ok, I made more test in a computer with win7 64 bit 16gb RAM:
Godot 2.1.3.:
64 bit editor can allocate in runtime more that 1gb (I can push an array more that 45 million times, I think that every "null" or "0" push is about 20 bytes.
32 bit editor goes OUT_OF_MEMORY on reach 550 mb, system says that goot continue allocating memory wrongly and slowly, but program freezes and console show the warning in loop. Godot become in loop mode and allocate and free memory until 558.000 and 564.000 kbytes. (I see in system, godot doesn´t have any function that indicates real memory used)
Edit: Other test in 64 bit editor pushing array to 100 million: System says that godot allocate 2 gb of memory. At this quantity, there are only three messages to console and immediately godot closes:
Messages:
ERROR: Vector class Variant ::resize: Condition '!_ptrnew' is true. Returned: ERR_OUT_OF_MEMORY
vector.h:295
ERROR: Vector class Variant ::push_back: Condition 'err' is true. Returned: true
vector.h:354
ERROR: StreamPeerWinsock::read: Server disconnected!
stream_peer_winsock.cpp:202
I will close this because i feel that this is not a real use issue and probably will be fixed by some optimization in typed gdscript when "variant" optimizations initiates.
Operating system or device - Godot version:
Godot 2.1.3.
Win 7 32 bit.
3,39 gb RAM usable
I don´t know if an array with 30.000.000 of "0" should freeze Godot, if this is normal I close the issue.
Issue description:
Push back an array with a value of "0" , 10 million times is ok
Push back an array with a value of "0", 30 million times throw:
Vector::push_back: condition 'err' is true. returned: true
Vector::resize: condition '!_ptrnew' is true. returned: ERR_OUT_OF_MEMORY
...And throw this error in loop freezing the program.
If I put other loop before, the freeze is with less iterations.
You can freeze godot with other kind of iterations (above 20.000.000 or 30.000.000 times)
without append nothing to dict or array.
Steps to reproduce:
Use the next code with 10 millions of iterations and 30 millions of iterations.
Link to minimal example project:
The text was updated successfully, but these errors were encountered: