Re: Why is virtual memory so high? (crash)
Re: Why is virtual memory so high? (crash)
- Subject: Re: Why is virtual memory so high? (crash)
- From: Shawn Erickson <email@hidden>
- Date: Mon, 26 Jan 2009 10:15:49 -0800
On Mon, Jan 26, 2009 at 4:52 AM, Mario Emmenlauer <email@hidden> wrote:
> I'm trying to find out why my application can use only ~2.8GB (instead
> of the full 4GB for a 32bit app) on a 10GB Machine.
Your applications virtual memory space is sprinkled with various
mapping for shared libraries/files that your process uses.
Additionally a few reserved ranges are also sprinkled thru-out the
memory space. Then you have guard pages, thread stacks, and your own
allocations (indirect or direct), file mappings, etc.
As a result of the shared libraries and related mappings on current
Mac OS X versions (when running as a 32b process) you will be lucky to
get much more then 3.0 GiB worth of pages mapped (think the best I
have seen with small allocations is 3.2) before exhausting the
available virtual memory of your process and you will exhaust
available _contiguous_ page ranges often earlier then 3.0 GiB (depends
on the size of the allocations you are doing and the history of
allocations in your application, aka VM fragmentation).
It sounds like you are at the limit of what a 32b virtual memory space
can handle. You either need to improve the logic of you code to reduce
memory usage (many ways exist, from the simple change of logic to
windowing) or switch your process to use 64b addressing.
Also note on Window you (IIRC) still get a 3/1 split 3 GiB of virtual
memory for your application and 1 GiB of virtual memory mapped for the
kernel in your process ... unless you set the system to not do that.
Also of that 3 GiB you will have a small part of it taken by mappings
for dlls, etc. So if your windows version is living OK in a similarly
constrained virtual memory situation you may simple be feeling the
effects of a different memory profile of how the APIs of the two
operating system work and/or exposing a "defect" in your code when
running on the Mac.
Note having a system with 10GiB of physical memory has no affect on
the limits of a 32b virtual memory space.
-Shawn
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden