From: "Michał Nazarewicz" <m.nazarewicz@samsung.com>
To: Nicholas Mc Guire <mcguire@lzu.edu.cn>, Joe <longapple@gmail.com>
Cc: Glynn Clements <glynn@gclements.plus.com>,
linux-c-programming@vger.kernel.org
Subject: Re: strange stack limit behavior when allocating more than 2GB mem on 32bit machine
Date: Fri, 21 Aug 2009 12:33:15 +0200 [thread overview]
Message-ID: <op.uy0cxpd9lak3lt@amdc030.digital.local> (raw)
In-Reply-To: <20090821093750.GA16299@opentech.at>
> On Fri, 21 Aug 2009, Joe wrote:
>> Thanks for your explanation. However as you can see, I got 2GB mem and
>> ~10GB swap, totally 12GB.
>>
>> With ulimit -s 10240(KB), I can allocate 2.5GB, I guess these are in
>> swap, right?
>> With ulimit -s unlimited, as you said, kernel reserved 1GB, stack
>> reserved 2GB, there are still 12-3=9GB left??
>>
>> Why did malloc failed, instead of allocating this abundant swap space?
On Fri, 21 Aug 2009 11:37:50 +0200, Nicholas Mc Guire <mcguire@lzu.edu.cn> wrote:
> Initializing 12GB swap will not change the address space limit unless you
> enabled high-memory support in the kernel (CONFIG_HIGHMEM64G=y in your .config)
> the limit is not the physical memory (RAM+swap) but the 32bit address space.
This won't help either since CONFIG_HIGHMEM64G (ie. Physical Address Extension)
affects only physical (not virtual) address space. Because Joe has 1 GiB
HIGHMEM64G it will only slow his computer down (virtual->physical address
translation requires one more read when HIGHMEM64G is enabled). Even with
gazillion GiBs of RAM CONFIG_HIGHMEM64G won't help here because the problem
is *virtual* address space limits which is 32-bit on 32-bit x86 systems
(regardless high memory (be it 4G or 64G) being enabled).
--
Best regards, _ _
.o. | Liege of Serenly Enlightened Majesty of o' \,=./ `o
..o | Computer Science, Micha³ "mina86" Nazarewicz (o o)
ooo +----<mina86@mina86.com>---<mina86@jabber.org>-ooO----(_)--Ooo--
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2009-08-21 10:33 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-21 3:47 strange stack limit behavior when allocating more than 2GB mem on 32bit machine Joe
2009-08-21 6:58 ` Glynn Clements
2009-08-21 9:12 ` Joe
2009-08-21 9:37 ` Nicholas Mc Guire
2009-08-21 10:33 ` Michał Nazarewicz [this message]
2009-08-21 9:38 ` Michał Nazarewicz
2009-08-21 11:04 ` Joe
2009-08-21 12:21 ` Michał Nazarewicz
2009-08-22 7:44 ` Glynn Clements
2009-08-21 7:09 ` Michał Nazarewicz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=op.uy0cxpd9lak3lt@amdc030.digital.local \
--to=m.nazarewicz@samsung.com \
--cc=glynn@gclements.plus.com \
--cc=linux-c-programming@vger.kernel.org \
--cc=longapple@gmail.com \
--cc=mcguire@lzu.edu.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).