• 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: saving big image crashes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: saving big image crashes


  • Subject: Re: saving big image crashes
  • From: "Louis C. Sacha" <email@hidden>
  • Date: Wed, 24 Nov 2004 00:41:34 -0800

Hello...

You do realize that a 32 bit 9,000 x 9,000 pixel image requires roughly 309 MB of memory for the raw data of the cached representation?

the new image is saved but the application crashes during reopening the resized image with a message as follows:
...
The point the application crashes is the line as follows:
aImage = [[NSImage alloc] initWithData:[newImage TIFFRepresentation]];

When you open the image, is there a particular reason why are you doing this? If you already have an NSImage instance (newImage) why do you need to create a second instance (aImage)?


Since the cache of a large image takes a large amount of memory, you will need to be very careful about managing and limiting the amount of temporary objects created. (Not to mention very very careful that you are not leaking memory or any of these large objects)


And when I resize the same image to 10000 x 10000 and save it with new size,
the application crashes during the new image is saved.

The program is abnoramlly exited at the line of code without any error code as follows:
TiffRef = [[NSBitmapImageRep alloc] initWithData:[temp_image TIFFRepresentation]];



You may also be running up against the limits that the window server places on the size of windows (which are used offscreen to cache bitmap representations of your images). I believe the size limit is 10,000 pixels, and I'm not sure if the NSImageRep code is capable of splitting the cache for an image between multiple windows.



You may want to spend a bit of time reading the info in the reference library regarding memory management and debugging memory issues:
<http://developer.apple.com/documentation/Performance/Conceptual/ManagingMemory/index.html>


Hope that helps,

	Louis
_______________________________________________
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


References: 
 >saving big image crashes (From: 김경옥 <email@hidden>)

  • Prev by Date: Re: 2 questions RE NSScrollView
  • Next by Date: Re: Accessing a file "comment"
  • Previous by thread: saving big image crashes
  • Next by thread: Re: saving big image crashes
  • Index(es):
    • Date
    • Thread