• 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
Mac app hitting per-thread stack size limit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Mac app hitting per-thread stack size limit


  • Subject: Mac app hitting per-thread stack size limit
  • From: Christopher Snowhill via Cocoa-dev <email@hidden>
  • Date: Thu, 14 Jul 2022 03:58:52 -0700
  • Feedback-id: i01794759:Fastmail

My app, Cog (https://cog.losno.co <https://cog.losno.co/> /
https://github.com/losnoco/Cog <https://github.com/losnoco/Cog>) is hitting the
stack size limit of 512 KiB on macOS. I am not even making heavy use of local
variables. I am, however, making a lot of Cocoa object allocations and
deletions, and using several nested autoreleasepools, and somehow, this,
combined with the C/C++/assembly libraries my app is using for file decoding,
hits the stack size limit.

I had to raise it for some recent additions. The recent additions do not use
local variables most of the time. In fact, they all use new/delete or
malloc/free already for large memory allocations. Yet somehow, I am hitting the
stack size limit rather easily.

I wish there were some sort of tool in Instruments that could organize memory
allocations in use throughout the process by which ones are specific to the
stack, so I could locate why my stack size is so grossly inflated.

I've already added a bodge for file playback threads by invoking NSThread with
setStackSize before starting it, but I also hit the limit with metadata reading
threads, which are invoked by NSOperationQueue, where I don't have control over
the stack size limit.
_______________________________________________

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: Mac app hitting per-thread stack size limit
      • From: Christopher Snowhill via Cocoa-dev <email@hidden>
  • Prev by Date: Greetings from Mr. Turritopsis Dohrnii Teo En Ming
  • Next by Date: Re: Mac app hitting per-thread stack size limit
  • Previous by thread: Greetings from Mr. Turritopsis Dohrnii Teo En Ming
  • Next by thread: Re: Mac app hitting per-thread stack size limit
  • Index(es):
    • Date
    • Thread