Skip navigation.
 
mlIn-loop releasing of objects does not free memory?
FROM : Arthur C.
DATE : Tue Feb 12 23:10:16 2008

I am writing a Cocoa-program to reduce a large amount of measurement data.
This involves reading in large files, like 6 MB each, in a loop over about 60 of them.
I try to release as many temporary objects as possible whenever I'm finished with them. However, the memory is not freed, as can be seen using Activity monitor, and by a dramatic slowdown due to memory overflow.

So the question is, how can I get the memory back? I need it for the next file(s)...

Code looks like this:

NSArray * files; // contains a list of filenames
for(i=0;i<[files count]; i++)
{
  NSString * dataFromFile = [[NSString alloc] initWithContentsOfFile: [files objectAtIndex: i]];
  < some processing >
  [dataFromFile release];
}

Autoreleased instances behave the same, i.e. no memory gets really freed.


Thanks for your time,

Arthur C.
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/_______________________________________________

Cocoa-dev mailing list (<email_removed>)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/<email_removed>

This email sent to <email_removed>

Related mailsAuthorDate
mlIn-loop releasing of objects does not free memory? Arthur C. Feb 12, 23:10
mlRe: In-loop releasing of objects does not free memory? j o a r Feb 12, 23:20
mlRe: In-loop releasing of objects does not free memory? John Terranova Feb 13, 01:22
mlRe: In-loop releasing of objects does not free memory? John Stiles Feb 13, 01:33
mlRe: In-loop releasing of objects does not free memory? John Terranova Feb 13, 02:10
mlRe: In-loop releasing of objects does not free memory? Shawn Erickson Feb 13, 17:57
mlRe: In-loop releasing of objects does not free memory? Shawn Erickson Feb 13, 18:07
mlRE: In-loop releasing of objects does not free memory? Arthur C. Feb 14, 09:43
mlRe: In-loop releasing of objects does not free memory? Randall Meadows Feb 14, 17:31
mlRe: In-loop releasing of objects does not free memory? Uli Kusterer Feb 14, 20:49
mlRe: In-loop releasing of objects does not free memory? Nick Zitzmann Feb 14, 21:12
mlRe: In-loop releasing of objects does not free memory? Randall Meadows Feb 14, 21:54
mlRe: In-loop releasing of objects does not free memory? Michael Watson Feb 14, 22:00
mlRe: In-loop releasing of objects does not free memory? Keith Duncan Feb 14, 22:22
mlRe: In-loop releasing of objects does not free memory? John Stiles Feb 14, 22:39
mlRe: In-loop releasing of objects does not free memory? Uli Kusterer Feb 15, 00:22
mlRe: In-loop releasing of objects does not free memory? Charles Steinman Feb 15, 00:56
mlRe: In-loop releasing of objects does not free memory? Jim Correia Feb 15, 04:57
mlRe: In-loop releasing of objects does not free memory? j o a r Feb 15, 05:36
mlRe: In-loop releasing of objects does not free memory? Jim Correia Feb 15, 14:41
mlRe: In-loop releasing of objects does not free memory? glenn andreas Feb 15, 16:28
mlRe: In-loop releasing of objects does not free memory? Adam P Jenkins Feb 15, 17:27
mlRe: In-loop releasing of objects does not free memory? Jim Correia Feb 15, 18:15
mlRe: In-loop releasing of objects does not free memory? j o a r Feb 15, 18:15
mlRe: In-loop releasing of objects does not free memory? Adam P Jenkins Feb 15, 19:56
mlRe: In-loop releasing of objects does not free memory? Keith Duncan Feb 15, 21:07
ml[Foo new] vs [[Foo alloc] init]: was Re: In-loop releasing of objects does not free memory? Adam P Jenkins Feb 15, 21:41
mlRe: [Foo new] vs [[Foo alloc] init]: was Re: In-loop releasing of objects does not free memory? Bill Bumgarner Feb 15, 21:57
mlRe: [Foo new] vs [[Foo alloc] init]: Keith Duncan Feb 15, 22:11
mlRe: [Foo new] vs [[Foo alloc] init]: Sean McBride Feb 15, 22:18