Re: ImageKit + GC = nogo? (or better... how :D)
Re: ImageKit + GC = nogo? (or better... how :D)
- Subject: Re: ImageKit + GC = nogo? (or better... how :D)
- From: Thomas Goossens <email@hidden>
- Date: Sun, 2 Dec 2007 18:14:58 +0100
Hi,
I see the same issue. But ImageKit may not be responsible.
I wrote a simple loop that creates thumbnails using ImageIO .
NO GC
All is fine: memory usage at the end of the loop : 4.93Mo
WITH GC:
the memory usage constantly gets higher : at the end of the loop:
785.12 Mo
Also using ImageKit with GC turned on but without ImageIO (by showing
iconRefs for instance) doesn't seems to leak.
So the issue seems to be in ImageIO or at a lower level.
I filed a new bug.
-- thomas
(the code for my test:)
{
int i;
NSURL *url = [[NSURL alloc] initFileURLWithPath:@"/Library/
Desktop Pictures/Nature/Ladybug.jpg"];
NSDictionary *optionsDict = [[NSDictionary alloc]
initWithObjectsAndKeys:[NSNumber numberWithInt:
(int)128],kCGImageSourceThumbnailMaxPixelSize,
kCFBooleanTrue,kCGImageSourceCreateThumbnailFromImageIfAbsent,
kCFBooleanTrue,kCGImageSourceCreateThumbnailWithTransform,
kCFBooleanFalse,kCGImageSourceShouldCache,
nil,nil];
for(i=0; i<400; i++){
id pool = [[NSAutoreleasePool alloc] init];
CGImageSourceRef sourceRef =
CGImageSourceCreateWithURL((CFURLRef)url, nil);
CGImageRef thumbnail =
CGImageSourceCreateThumbnailAtIndex(sourceRef, 0,
(CFDictionaryRef)optionsDict);
CGImageRelease(thumbnail);
CFRelease(sourceRef);
[pool drain];
[pool release];
}
[optionsDict release];
[url release];
}
On Dec 1, 2007, at 7:21 PM, Dominik Pich wrote:
Hi,
I have build a small sample app - following the example code given
in the doku about it.
Nothing facy: a browser and an image view (my addition to the sample)
then I tested with my ~/Pictures ( lets say..... 15000)
NO GC
All is fine! Memory usage is quite constant for my tests.
WITH GC
Then I went and set GC to required for my app.
(Code; no more retain/release calls - for this test.... but that
shouldn't influence ImageKit)
Checked if GC is enabled for my app and all its Libs by adding
OBJ_PRINT_GC=YES to my build path. All looking good.
But now my memory usage constantly gets higher and once I run out of
RAM things go down (as they tend to do when you leak ... )
So.. what am I doing wrong?
I can't believe that Framework is so 'buggy' and therefore I am
curiose as to where I made a mistake. Maybe even a totallyobvious
one I forgot... like...... have I to do more than require GC in
build settings to make it active?
Thanks,
Dominik
BTW: Code and performance samples can be provided :) My code is
actually REALLY simple, no threading - nothing. (See ImageKit sample)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden