Re: Why is virtual memory so high? (crash)
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=k2ht/Yim+B9D9IJJr+GJF/rndsKBN9ostrLEJ5XD5UI=; b=sbMReMGV0CmhZoOkUNt7R2DhSw+iU1ggXqlYbC6XYlFhXDewbuQX3x8zfxVHoULbV3 yOxy8UU/JK4rjEAPKq8qNyQXevxgFYBSZlu5SaU4jzBaD8rbms808I/bKSHysk+pjoqy 2W02ApgrCJk5mKKyhIMyIFdu18yBqMfMGDXcc= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=Cl5mGmCdtocAmG3s3B0+YHFNotuNmIMLNNKraa/KK54kQG9UsKoe3BKSUp2KjGVPZ4 gtNbGy+kJ/GgbGGfR7QSOeGBfmDSYjaB7uR45dBJ36xll9iV9SPsolrYuiudlxnFJzvk C3L/3OPNSasp6KH5STsqtqBiIRe3X7lhQjSx0= On Mon, Jan 26, 2009 at 4:52 AM, Mario Emmenlauer <mario@emmenlauer.de> 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 (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Shawn Erickson