SMySQL releasing the Results or Am I misunderstanding Autorelease?
SMySQL releasing the Results or Am I misunderstanding Autorelease?
- Subject: SMySQL releasing the Results or Am I misunderstanding Autorelease?
- From: Ole Voß <email@hidden>
- Date: Sat, 26 Nov 2005 11:58:32 +0100
Hello everybody,
I'm using the SMySQL Framework to do extensive database queries. By
extensive I mean doing multiple queries on several 100.000 Datasets.
The problem I'm encountering is that my App gobbles up loads of memory
while doing the queries. I presume this is because the returned Results
(MCPResult) are set to be 'autorelease' by the Framework.
My understanding of the autorelease pool is that it is only freed at
the end of each event-loop (or maybe the beginning, but that is not
relevant I think). Since my App takes a long time to run these queries,
the event-loop is not reached until all computations are done. Which
means that I am 'loosing' very much memory during the run - sometimes
resulting in crashes.
Which brings me to two solutions and consequently two questions:
1) I could release the Result (which is already 'autorelease') after I'm
done with it - but waaaay ahead of the end of the event-cycle.
Q) Am I allowed to release Objects which are marked 'autorelease' when
I'm certain that they are no longer required?
2) I could put the whole query in a seperate thread.
Q) But I believe this would not really change anything since each thread
has its own autorelease-pool?!
I know this question might be more about autoreleasing and memory
management, but I thought somebody might have encountered this Problem
in connection with SMySQL. I've been surfing and reading for a week. I
need help :-)
Thank you everybody.
Ole.
_______________________________________________
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