I'm looking for advice/techniques on how to monitory memory usage of a gideros project. Currently I'm flying blind just throwing things on a scene until it looks good. I need to keep an eye on resources utilization.
An addition to @MikeHart, to monitor texture memory usage, you can look at logcat (for Android) or Xcode's console _while waiting for the next version_. You should see a log like:
Inserting sky_world.png to the texture cache. Total memory is 1024 KB. Inserting bird_black_01.png to the texture cache. Total memory is 1056 KB. Inserting bird_black_02.png to the texture cache. Total memory is 1072 KB. Inserting bird_black_03.png to the texture cache. Total memory is 1104 KB. Increasing refcount of bird_black_01.png. New refcount is 2. Increasing refcount of bird_black_02.png. New refcount is 2. Increasing refcount of bird_black_03.png. New refcount is 2. Inserting bird_white_01.png to the texture cache. Total memory is 1136 KB. Inserting bird_white_02.png to the texture cache. Total memory is 1152 KB. Inserting bird_white_03.png to the texture cache. Total memory is 1184 KB.
Comments
Atilim posted this peace of code a few days ago:
Inserting sky_world.png to the texture cache. Total memory is 1024 KB.
Inserting bird_black_01.png to the texture cache. Total memory is 1056 KB.
Inserting bird_black_02.png to the texture cache. Total memory is 1072 KB.
Inserting bird_black_03.png to the texture cache. Total memory is 1104 KB.
Increasing refcount of bird_black_01.png. New refcount is 2.
Increasing refcount of bird_black_02.png. New refcount is 2.
Increasing refcount of bird_black_03.png. New refcount is 2.
Inserting bird_white_01.png to the texture cache. Total memory is 1136 KB.
Inserting bird_white_02.png to the texture cache. Total memory is 1152 KB.
Inserting bird_white_03.png to the texture cache. Total memory is 1184 KB.
~Chip
I've see a message:
Edit: I have another question. garbage collector will collect resource when refcount is 0 or 1?