• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Memory not freed with CIImage
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Memory not freed with CIImage


  • Subject: Memory not freed with CIImage
  • From: Stefano Falda <email@hidden>
  • Date: Wed, 11 Jun 2008 23:53:19 +0200

Hello,
I've got some code similar to the following, in which I loop in a list of image files and draw their content to another image.


I'm working with X-Code3 under Leopard with Garbage Collection ON, but something seems to go wrong, because at the end of all the operations the memory is not released (in Activity Monitor there are >400 MB still active that disappear if I close my application).

I've tried using NSImage instead of CIImage and everything seems to work ok, the memory goes up and then down to where it was before the operation, but the process takes 1.5>2 times more than with CIImage.

This is an extract of the code:

for (id loopItem in images) {
			NSString * imageFileName=(NSString*) loopItem;

destRect=NSMakeRect(currentPos.x, currentPos.y, mosaicSize.width, mosaicSize.height);

CIImage* thisImage2=[CIImage imageWithContentsOfURL:[NSURL fileURLWithPath:imageFileName]];
if (thisImage2!=NULL)
{
[thisImage2 drawInRect:destRect fromRect:NSMakeRect(0,0, [thisImage2 extent].size.width,[thisImage2 extent].size.height) operation:NSCompositeSourceOver fraction:1.0];
}
}

Maybe I'm missing something very stupid, because I'm new to Objective- C and Mac Programming.


I thought that, being a newbie, using Garbage Collection I could ease my life, but I'm thinking if I need to recode this project with standard memory management.

I hope that someone can explain where I'm making something wrong.

Thank you

Stefano
_______________________________________________

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


  • Follow-Ups:
    • Re: Memory not freed with CIImage
      • From: Nick Zitzmann <email@hidden>
  • Prev by Date: Re: -insertNewline: and -insertLineBreak:, using the shift key modifier
  • Next by Date: Re: -insertNewline: and -insertLineBreak:, using the shift key modifier
  • Previous by thread: Re: -insertNewline: and -insertLineBreak:, using the shift key modifier
  • Next by thread: Re: Memory not freed with CIImage
  • Index(es):
    • Date
    • Thread