Functions to help control memory leaks
Is it possible to write functions that will output what is still in memory (images, widgets, timers, sounds, local and global variables, etc) at any point?
I would like to see output to the console so I can be more confident that I cleared what is necessary.
local function printMemUse()
print(system.getInfo("textureMemoryUsed")/1048576, "texture memory used in mb")
Put this on a loop and call it as often as you want. If your memory usage isn't going up then your good.