Game Development Community

Instruments memory leak explanations

by Watermark · in iTorque 2D · 08/29/2012 (8:09 am) · 1 replies

I attached the Instruments Memory Leak detector to my iTorque game and got some results. However, I don't understand what they mean so can anyone help me figure this out? Thanks!

1. When I use in script %txml = new ScriptObject() { class = "XML"; }; as well as some xml operations, the following appears:
Leaked Object: Filestream
Size: 8.50 KB
Responsible Frame: TiXmlDocument::LoadFile(char const*)

This happens the most as I use xml to store game data (characters, monster stats, item stats, etc.). I always delete the object afterwards (%txml.delete()), but this does not seem to be effective.

2.
Leaked Object: Filestream
Size: 48 bytes
Responsible Frame: Dictionary::add(char const*, char const*, bool)

I have no idea where this came from.

About the author

Three iTorque 1.5 games published: Sorceria 1: The Mad Doctor RPG Sorceria 2: Sunken City Sagas: RPG Boardgame and Name Generator For more info see our site: http://wmrpg.weebly.com


#1
09/18/2012 (7:47 am)
I'm no expert on the instruments but it seems like you're leaking a filestream object. Do you know if the filestream object is being cleaned up properly? It's possible a parent or wrapping object is not handling it correctly. It's possible you need to call some specific method on the object to get it to release it's resources. You should be able to find out from the call stack or the docs.

If you solved it, let us know what you did.