In article <gwestonREMOVE->,
Gregory Weston <> wrote:
> In article <matsw->,
> Mats Weber <> wrote:
>
> > I need to allocate more than 2 Go of memory in a C++ program with no
> > user interface (no Carbon or Cocoa).
> >
> > When I try to cross the 2 Go barrier, I get the following messages:
> >
> > *** malloc: vm_allocate(size=1069056) failed (error code=3)
> > *** malloc[15141]: error: Can't allocate region
> > *** malloc: vm_allocate(size=1069056) failed (error code=3)
> > *** malloc[15141]: error: Can't allocate region
> >
> > and the program stops.
> >
> > This is on a dual G5 with 4 Go of RAM and enough hard disk space,
> > running Mac OS X 10.3.5. I checked ulimit, there is no limit.
>
> That's a documented limitation in OS X. I can't remember if it's known
> that this will change in 10.4.
I don't think it's strictly a 2 GB limit -- rather, it has to do with
how things are laid out in memory and a very carefully designed program
may be able to allocate a little bit more.
That said, you can access more memory on a G5 today with certain messy
techniques involving something like mapping and unmapping large blocks
of memory. Check the archives of Apple's darwin-development mailing
list or ask DTS for details.
-Eric
--
Eric Albert
http://rescomp.stanford.edu/~ejalbert/