I was testing creation and destruction speed and performance found myself using this code:
PS: "obj_system" is just an empty object!
the problem here is that after the big repeat chunk (that happens ONE time, during the creation code of one room - "room_test") I find the memory usage in the 33933,42K ...it's an empty project, no more rooms, no more objects, just this test room!! The value doesn't decay over time..
Is instance_destroy not freeing memory?! (it is at least freeing SOME memory... as during repeat the memory goes up to (+/-) 80000K and then drops to the 34000K. Is this suppose to happen?
in the end of the process, frame rate is stable and very high (6000fps, read in the debugger) so I guess the instances are correctly being removed from the internal update list... but the memory doesn't get totally freed.
Do you have the same problem? What do you think?!
Code:
#macro times 100000
var i, time;
var create = 0, destroy = 0:
repeat (times) {
time = get_timer();
i = instance_create_depth(0,0,0,obj_system);
create += get_timer()-time;
time = get_timer();
instance_destroy(i);
destroy += get_timer()-time;
}
var total = "(x" + string(times) + ")";
show_debug_message("Instance create " + total);
show_debug_message(create/times);
show_debug_message("Instance destroy " + total);
show_debug_message(destroy/times);
the problem here is that after the big repeat chunk (that happens ONE time, during the creation code of one room - "room_test") I find the memory usage in the 33933,42K ...it's an empty project, no more rooms, no more objects, just this test room!! The value doesn't decay over time..
Is instance_destroy not freeing memory?! (it is at least freeing SOME memory... as during repeat the memory goes up to (+/-) 80000K and then drops to the 34000K. Is this suppose to happen?
in the end of the process, frame rate is stable and very high (6000fps, read in the debugger) so I guess the instances are correctly being removed from the internal update list... but the memory doesn't get totally freed.
Do you have the same problem? What do you think?!
Last edited: