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
Klehrik says:
It seems that iterating through large (perhaps all but it's more noticeable with more elements) gamemaker arrays often (like every frame) causes a gradual memory leak(?)
Example (in __input_system_tick):
-- This causes memory usage to increase unboundedlocalclass_item=gm.variable_global_get("class_item")
for_, iinipairs(class_item) do-- empty-- nothing else has to be done, just iterating causes thisend
Just open task manager and watch RoRR memory usage for a few minutes
I tried with a newly created array containing 200 0s as well and the same thing happens
I think the problem might just be with using ipairs to iterate over it
-- This seems to be finelocalclass_item=gm.variable_global_get("class_item")
localsize=gm.array_length(class_item)
fori=0, size-1dogm.array_get(class_item, i)
end
Additionally, accessing arrays with lua syntax instead of gm.array_get also causes gradual memory usage
-- This causes increasing memory usagelocalclass_item=gm.variable_global_get("class_item")
localsize=gm.array_length(class_item)
fori=0, size-1dolocalitem=class_item[i]
end-- This is finelocalclass_item=gm.variable_global_get("class_item")
localsize=gm.array_length(class_item)
fori=0, size-1dolocalitem=gm.array_get(class_item, i)
end
Klehrik says:
It seems that iterating through large (perhaps all but it's more noticeable with more elements) gamemaker arrays often (like every frame) causes a gradual memory leak(?)
Example (in
__input_system_tick
):Just open task manager and watch RoRR memory usage for a few minutes
I tried with a newly created array containing 200
0
s as well and the same thing happensRelated code: https://github.com/return-of-modding/ReturnOfModding/blob/5a15338e95b4bb6a1b075fea9276d3056948a6d3/src/rorr/gm/pin_map.hpp
The text was updated successfully, but these errors were encountered: