How to properly manage texture memory

I followed the tutorial here:
http://developer.anscamobile.com/code/display-objects-and-texture-memory
But memory doesn’t seem to get freed when in my project.

To verify this, I created this simple project:

[lua]local splashScreen = nil
print( “TextureMemory: " … system.getInfo(“textureMemoryUsed”) … " bytes” )
– output: TextureMemory: 0 bytes
splashScreen = display.newImage(“splash_screen.png”, 0, 0)
print( “TextureMemory: " … system.getInfo(“textureMemoryUsed”) … " bytes” )
– output: TextureMemory: 664320 bytes
splashScreen:removeSelf()
splashScreen = nil
print( “TextureMemory: " … system.getInfo(“textureMemoryUsed”) … " bytes” )
– output: TextureMemory: 664320 bytes[/lua]

What gives? Am I allocating/deallocating things the wrong way? Or is there a bug? I’m using version 2010.9.16.148 [import]uid: 7026 topic_id: 3256 reply_id: 303256[/import]

I guess it works ok, but you check for it too soon.

Place your print to a timer, like this (check the syntax plz):
[lua]timer.performWithDelay(1000,function() print( “TextureMemory: " … system.getInfo(“textureMemoryUsed”) … " bytes” ) end, 10)[/lua]

[import]uid: 7356 topic_id: 3256 reply_id: 9675[/import]