• 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
Re: Weird malloc error when dealing with lots of NSImage objects
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Weird malloc error when dealing with lots of NSImage objects


  • Subject: Re: Weird malloc error when dealing with lots of NSImage objects
  • From: DairyKnight <email@hidden>
  • Date: Tue, 8 Sep 2009 13:12:37 +0800

I found the problem. It seems rather than autoreleasing the outputBitmapRep,
I should first CGImageReleasethe 'thickenedCGImg'. This creates a dilemma
because thickenedCGImg lies inside a function.

I have to change the function to return a CGImage instead. From Apple's
Cocoa document, it says the
NSImageBitmapRep which [NSImgRep CGImage] returns is 'Readonly', so that
probably means releasing
the object doesn't release the correspondent CGImage.




On Tue, Sep 8, 2009 at 12:06 AM, Bill Bumgarner <email@hidden> wrote:

> On Sep 7, 2009, at 4:45 AM, DairyKnight wrote:
>
>  FooProgram(1343,0xa01e1720) malloc: *** mmap(size=30855168) failed (error
>> code=12)
>>
>> *** error: can't allocate region
>>
>> *** set a breakpoint in malloc_error_break to debug
>>
>> 2009-09-07 19:37:17.606 KindPDF[1343:10b] ***
>> NSCopyMemoryPages(0xfc18a000,
>> 0x0, 30851072) failed
>>
>
> You have run out of memory and the allocator has failed.  In this case, it
> is a memory-mapped file that is failing which leads to a call to
> NSCopyMemoryPages() with an address of 0x0 as the destination.
>
> Either your app is leaking memory -- which may be in the form of
> over-caching -- or you are simply trying to shove too much stuff into memory
> at the same time.
>
> Use Instruments' Object Alloc instrument to see what is chewing up the
> space.
>
> b.bum
>
_______________________________________________

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

References: 
 >Weird malloc error when dealing with lots of NSImage objects (From: DairyKnight <email@hidden>)
 >Re: Weird malloc error when dealing with lots of NSImage objects (From: Bill Bumgarner <email@hidden>)

  • Prev by Date: Re: NSImage rotation regression?
  • Next by Date: Re: Problem with LSSharedFileListInsertItemURL() usage. (API in LaunchServices/LSSharedFileList.h)
  • Previous by thread: Re: Weird malloc error when dealing with lots of NSImage objects
  • Next by thread: Making an NSAlert be displayed when the User attempts to delete a row from an NSOutlineView when it has children.
  • Index(es):
    • Date
    • Thread