Instruments makes app quit when testing for leaks

Discussion in 'iOS Programming' started by Enuratique, Jun 28, 2008.

  1. Enuratique macrumors 6502

    Apr 28, 2008
    Hi all,

    I was wondering if any one knew what would cause Instruments to just crap out while recording Leaks / Object Allocation? To give some context as to what my program is doing when it craps out:

    I have a ViewController class that initializes a custom written data source class that implements the UITableViewDataSource protocol. I implemented the ViewController's awakeFromNib to allocate an instance of my custom data source class. The init method of the custom data source class is a sort of heavyweight operation in terms of memory - it parses a flat text file of words (around 40,000 words in my word list) and builds a tree for each word in the list for fast searching. There end up being around 100,000 nodes taking up roughly 38 MB of RAM after all is said and done.

    It appears that the initialization phase completes succesfully before Instruments stops recording and my app appears to have quit on the iPhone Simulator. Fortunately, during that time it found no leaks. I've been pretty careful about how I use the memory. But there are operations past initialization I'd like to test for leaks - like searching the word list I've just parsed. Now, I've figured out that I can just attach Instruments to the iPhone debugger after initialization has occurred and go from there - again no leaks found :)

    The weird part is, the first time I ever tried testing for leaks, this didn't happen - it got past the initialization phase and I was able to test my other operations for leaks as well but haven't gotten Instruments to behave since.

    Anybody have any ideas what could be causing this? I'm pretty sure my code is solid at this point, so it's not a big deal, but is kind of annoying nonetheless.



Share This Page