GetColor() alloc memory and never release on iOS?
Monkey Forums/Monkey Programming/GetColor() alloc memory and never release on iOS?
| ||
Just store color array in a local var in render loop. I found the memory allocation continuing increase with the tool xCode Instruments. It's mostly increased by gc_malloc of GetColor's array. Why did the local array not destroyed after a loop finished? code snip here: [monkeycode] Method OnRender:Int() Cls Local color := GetColor() Return 0 End [/monkeycode] |
| ||
Maybe it's a GC problem. The memory will increase fast with following code . All strings and arrays allocated locally are not destroyed. [monkeycode] Method OnRender:Int() Cls For Local i:=0 To 100000 Local color := ["1", "2", "3"] End Return 0 End [/monkeycode] Do you have the same problem? |
| ||
the GC collects after OnUpdate or OnRender are done. |
| ||
In my opinion this is not very elegant specially when combined with the new targets design.Mark mentioned something about a realtime gc for c++ a while ago |
| ||
I would love to be able to call the GC manually, much like in BlitzMax. |