• 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: memory warnings
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: memory warnings


  • Subject: Re: memory warnings
  • From: Jens Alfke <email@hidden>
  • Date: Wed, 12 Mar 2008 12:53:59 -0700


On 12 Mar '08, at 11:00 AM, John Stiles wrote:

You can dive into BSD to get some values which might help you.

I'm not an expert on this, but I've listened in on email threads where OS X kernel engineers were giving answers.


Trying to preflight memory allocations is, basically, not feasible. Your process's address space gets fragmented, so just because X amount is free doesn't mean an attempt to allocate X will succeed.

Going 64-bit will keep you from running out of address space. (The next limit you hit will probably be when the app's working set exceeds available physical RAM, and the system will start to thrash like crazy. After that, you might fill up the hard drive and run out of swap space, in which case you'll crash.)

If the data you're manipulating comes directly from files, try to memory-map them instead of copying the contents into your heap. That can really help.

—Jens

Attachment: smime.p7s
Description: S/MIME cryptographic signature

_______________________________________________

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 warnings
      • From: John Stiles <email@hidden>
References: 
 >memory warnings (From: Alexander Cohen <email@hidden>)
 >Re: memory warnings (From: Nick Zitzmann <email@hidden>)
 >Re: memory warnings (From: John Stiles <email@hidden>)

  • Prev by Date: Re: Mute System
  • Next by Date: Re: BitMap data format and autorelease
  • Previous by thread: Re: memory warnings
  • Next by thread: Re: memory warnings
  • Index(es):
    • Date
    • Thread