I am writing an iPad app that downloads a rather large .csv file and parses the file into objects stored in Core Data. The program keeps crashing, and I’ve run it along with the Allocations performance tool and can see that it’s eating up memory.
Nothing is alloc’ed or init’ed in the code, so why am I gobbling up memory?
Code at: http://pastie.org/955960
Thanks!
-Neal
There’s no leaks. But you’re allocating a new array and string every loop, which will accumulate when the input is very long, before the autorelease pool can drain.
Since these are temporary variables, you could just move them outside of the loop, and reset them on an iteration.