Re: Running out of process VM
Re: Running out of process VM
- Subject: Re: Running out of process VM
- From: "Shawn Erickson" <email@hidden>
- Date: Thu, 13 Apr 2006 15:41:05 -0700
On 4/13/06, M. Carlson <email@hidden> wrote:
> I'm writing a Cocoa app (10.4.6, Xcode 2.2, PM 2xG5 2GHz, 8GB), and I'm
> loading large tensor matrices, 1.1 GB each. The problem is that I can only
> load one, the second one crashes the app with malloc complaining "cannot
> allocate memory". I've verified in gdb that the size I'm requesting is
> correct.
>
> Base VM of the app is 380 MB. After loading one of the tensor matrices, it
> goes up to 1.48 GB. But why should loading the next 1.1 GB tensor matrix
> cause the app to blow?
It has to do with contiguous allocation in your virtual address space.
You are asking for a large allocation which by definition must be
contagious in virtual addresses yet your virtual address space don't
have a free range of such addresses available. If possible can you
break up the allocation into smaller blocks?
> Adding the next one should only bring it up to 2.58 GB (Safari currently is sitting at 2.66 GB).
That is because it has many many small allocations that can fit in the
available ranges in your virtual address space.
> Don't I have 4 GB (or thereabouts) of VM available to the app?
You have about 3 to 3.5 GB of available address space with the largest
single allocation in the 2 to 2.5 GB range (assuming you don't start
to fragment your virtual address space). All values can vary by OS
version and depending on the set of frameworks you dynamically link
against, etc.
> Do the new Intel machines have a 64-bit VM address space?
No, none of the Intel systems that Apple has shipped so far support
64b addressing nor does any version of Mac OS X at the Cocoa level.
You can get 64b addressing on a G5 system if your application only
links against libSystem.
<http://developer.apple.com/macosx/64bit.html>
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden