views:

47

answers:

1

Hi!

My app is using quite a bit of memory and therefore it's often get killed by the watchdog. In my efforts to reduce memory consumptions (and change some other stuff too) I've rewritten some of the system functions (replaced few CoreText classes to be exact).

That actually went pretty well and I've managed to reduce memory consumption by ~3mb (according to allocations and memory monitor instruments).
Nevertheless, now my application is getting killed by watchdog way sooner. When old version is still working (even though consuming more memory) new version gets killed by OS.

I think that it might be happening due to an excessive use of malloc/free to alloc/free lots of small structures on the heap.

Is it so?
What other problems might be causing this behavior (memory consumption decrease / watchdog kills app faster)?
Can it be due to a fact that its my app managing memory now and not the system library?

+1  A: 

If you are getting a watchdog, that simply means you are being non-responsive for too long. You need to put some code in place to update the user that you are busy. You should also provide a cancel function on the screen to allow the user to abort the process that is taking too much time.

Steven Noyes
What I mean is my application is getting killed with "signal "0"". I believe that means that application was killed by the watchdog, or am I wrong?
Alexey
No, Signal 0 is an indication of no memory. The watchdog is a device that measures if the program is out to lunch. For example, in an endless loop. If you do not check in periodically, the OS will simply kill you. Signal 0 indicates you have a leak or are simply using too much memory.
Steven Noyes