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

Re: large memory malloc


  • Subject: Re: large memory malloc
  • From: Mark Bessey <email@hidden>
  • Date: Thu, 30 Jun 2005 17:47:38 -0700

On Jun 30, 2005, at 5:32 PM, James E. Hopper wrote:

i have a simple xcode project that does a malloc that for the latest data set has grown to just under 3gb. the malloc is failing (on 10.3.9). since i have 4gb of ram and the docs imply i can access up to 4gb space without having to go to 64 bit addressing, i was hoping there was something simple i could do to make this work?

There probably isn't anything simple you can do to solve the problem without reworking your code, at least a little. While your process has a 4GB address space, there is bound to be some fragmentation of the available space, so the largest block you can allocate will always be somewhat smaller.


Not knowing what your project is actually trying to do, I'm reluctant to give any specific advice, but you might want to look into splitting your data processing up a bit. If you can work with smaller pieces and move them in and out of memory as needed, that ought to take care of this problem. And you won't just be delaying the problem until your data set grows more.

docs for ld on linux speak of an option --heap that lets you set the max heap size, but this is not available on the os x linker.

I don't think there's a need for such a switch on OS X - if I recall correctly, the last time I checked, the amount of memory I could malloc() was pretty close to the 4GB mark (if I allocated it in small enough chunks).


-Mark

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: large memory malloc
      • From: "Justin C. Walker" <email@hidden>
    • Re: large memory malloc
      • From: "James E. Hopper" <email@hidden>
References: 
 >large memory malloc (From: "James E. Hopper" <email@hidden>)

  • Prev by Date: large memory malloc
  • Next by Date: Re: large memory malloc
  • Previous by thread: large memory malloc
  • Next by thread: Re: large memory malloc
  • Index(es):
    • Date
    • Thread