How do you check memory usage?

Thanks for reading.

How do you check the current memory usage?
I want to check it because I want to figure out the source of memory leak in my app.
Thanks. [import]uid: 12769 topic_id: 7974 reply_id: 307974[/import]

I would also like to know this. I see other people in the forums able to check how much memory is being used and how much is left over. Would very much appreciate this. [import]uid: 31262 topic_id: 7974 reply_id: 28392[/import]

Do you mean texture memory? If so then use something like this:

print(system.getInfo( “textureMemoryUse” )) [import]uid: 11809 topic_id: 7974 reply_id: 28419[/import]

The lua function, collectgarbage(“count”), will return the amount of memory used by Lua. [import]uid: 34551 topic_id: 7974 reply_id: 28444[/import]

Thanks very much.

textureMemoryUse and collectgarbage are both what I want.

By the way, how do you debug memory leak caused by careless design of code? Is there something like “watch window” or a function that can show all the variables (created by the user) that are stored in the memory?

Thanks. [import]uid: 12769 topic_id: 7974 reply_id: 28725[/import]