• 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: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation


  • Subject: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
  • From: Greg Parker <email@hidden>
  • Date: Wed, 18 Feb 2009 12:17:22 -0800

On Feb 18, 2009, at 3:22 AM, Michael Vannorsdel wrote:
Really it would be best to malloc the space, use it, and free it. Once you get to huge stack usage you gamble that you won't run out when there can be other higher up calls also consuming some (frameworks, libs, 3rd party code, ect). Also if you only use the large amount once in a while then you have a bunch of unutilized memory sitting around.

Agreed: use malloc for large memory allocations.

One other limit that you apparently haven't run into yet: some architectures limit the maximum size of a single stack frame, even if there is lots of space on the stack. ppc has a maximum 64K stack frame size; arm may have a similar limit.


-- Greg Parker email@hidden Runtime Wrangler


_______________________________________________

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: 
 >Running out of memory on stack in C++ routine invoked within Cocoa NSOperation (From: Leo Singer <email@hidden>)
 >Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation (From: Michael Vannorsdel <email@hidden>)

  • Prev by Date: Re: sticky video/audio files in NSTextView with GC on
  • Next by Date: Re: How to force a message to a overriding method from within an init method
  • Previous by thread: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
  • Next by thread: Re: Running out of memory on stack in C++ routine invoked within Cocoa NSOperation
  • Index(es):
    • Date
    • Thread