How odd.
I just ran your code too, no changes in memory usage.
I just ran my code again for 10,000 iterations. Steady memory increase from 30 MB to 70 MB.
I then changed instance.a in your code from being initialized to 999 to instead being set to
CreateSprite(LoadImage("a.png"))
and immediately noticed a memory leak.
I thought maybe it could be that I am not deleting the image created with LoadImage, but in my code I am not repeatedly loading the image - I have it defined as a constant upon initial booting of the app.
I changed the line from
instance.a = CreateSprite(LoadImage("a.png"))
to
//at beginning of program
#constant im = LoadImage("a.png")
//Where the old instance.a = 999 was before
instance.a = CreateSprite(im)
Therefore, I am going to conclude that it is something wrong with the Create/DeleteSprite functions. Am I forgetting to do something with these sprites that I really should be doing?
(Complete edited code that causes memory leak: )
type tData
a as integer
b as integer
endtype
global arrData as tData[]
#constant im = LoadImage("a.png")
SetVirtualResolution(500, 500)
SetSyncRate(1000,0)
count = 0
do
insert()
remove()
print(str(count))
sync()
inc count,1
loop
function insert()
local instance as tData
instance.a = CreateSprite(im)
SetSpritePosition(instance.a, 200, 200)
print(GetSpriteExists(instance.a))
instance.b = 999
arrData.insert(instance)
endfunction
function remove()
DeleteSprite(arrData[arrData.length].a)
arrData.remove(arrData.length)
endfunction