Re[2]: NSTableView and memory management problem.
Re[2]: NSTableView and memory management problem.
- Subject: Re[2]: NSTableView and memory management problem.
- From: Dmitry Basko <email@hidden>
- Date: Mon, 28 Mar 2005 22:52:30 +0200
Hello,
MN> Use ObjectAlloc, not Activity Monitor (as I've said three times in the last
MN> week, it seems). That is the only way to pierce the veil of virtual memory
MN> and see whether *you* are actually leaking memory. If you are not, then just
MN> don't worry about it. m.
Thanks for your replay. I will bear it in mind. But it was only the
first attempt to see what happens wrong with my code.
Two additional words how my code works:
a)Reading of table is divided into two parts.
Before the Panel with grid is shown to user, I read 15 records. After
that I am starting Timer object and show the Panel.
b)in timer_action procedure I continue the reading of the rest and
display the appropriated messages in case of need.
(there is unexpected delay here, in reality it is the unwanted call of
NSPopAutoreleasePool)
When user wants to close the Data Viewer he presses button "Close" and
inside of its handler I clean up and deallocate the used memory.
a) delete all TableColumns;
b) delete all cells (NSCell) inside of the certain row and the row
itself (NSMutableArray)
c) delete the main index array(NSMutableArray), previously containing
rows (NSMutableArrays); I have not intentionally used "autorelease", I
planed to clean up all by hands.
Of course those operations require some time (it's clearly seen during
the debug session) - seconds. After that application seems to be
frozen (It does not consume CPU time (very little)) for 10-20 seconds.
When I debug this stage in "step" mode I see that the code is calling
"NSPopAutoreleasePool" again. So, there are two moments when very time
consuming NSPopAutoreleasePool are called - when I leave "timer_action"
function and when the modal panel is going to be closed.
I think this behaivior generally is correct, but in my particular case these
calls (NSPopAutoreleasePool) do only harm - they consume very valuable
time, although all resources have been released manually.
May be I misunderstand something but it would be good to avoid these
calls - there is no real need, because no one object is supposed to be
autoreleased.
Sorry for such a long post, simply try to explain the situation is
detail. Any suggestions are welcome!
Dmitry Basko.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden