linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David Schwartz" <davids@webmaster.com>
To: <linux-kernel@vger.kernel.org>
Subject: RE: Memory Allocation
Date: Tue, 17 Apr 2007 21:47:28 -0700	[thread overview]
Message-ID: <MDEHLPKNGKAHNMBLJOLKEEOPDBAC.davids@webmaster.com> (raw)
In-Reply-To: <14CFC56C96D8554AA0B8969DB825FEA002C99168@chicken.machinevisionproducts.com>


> My test machine is a Dell Precision 490 with dual 5140 processors and
> 3GB of RAM.  If I reduced kMaxSize to (2048 * 2048 * 236) is works.
> However, I need to allocate an array of char that is (2048 * 2048 * 256)
> and maybe even as large at (2048 * 2048 * 512).
>
> Obviously I have enough physical memory in the box to do this.  However,
> I suspect that I'm running out of page table entries.  Please, correct
> me if I'm wrong; but if I allocate (2048 * 2048 * 236) it work.  When I
> increment to 256 or 512 it fails and it is my suspicion that I just
> don't have enough more in kernel memory to allocate this much memory in
> user space.

It is unreasonable to expect single allocations this large to succeed on a
32-bit OS. Either get a 64-bit OS or use a number of smaller allocations.

You may want to use mmap'ed files instead of malloc'ed memory. You can them
mmap however many files you can at once, and unmap and remap them as needed.

DS




  parent reply	other threads:[~2007-04-18  4:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-04-17  2:17 Memory Allocation Brian D. McGrew
2007-04-17  7:06 ` Eric Dumazet
2007-04-18  4:47 ` David Schwartz [this message]
     [not found] <fa.BkbRyK9fXhgijRwEDN4ejyJhMRQ@ifi.uio.no>
2007-04-17  5:08 ` Robert Hancock
  -- strict thread matches above, loose matches on Subject: below --
2003-09-14 18:44 1:1 M:N threading Breno
2003-09-14 19:11 ` Robert Love
2003-09-16 15:04   ` Memory allocation Breno
2001-02-27 16:55 Ivan Stepnikov
2001-02-27 17:51 ` Wayne Whitney
2001-02-27 17:55 ` Peter Samuelson

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=MDEHLPKNGKAHNMBLJOLKEEOPDBAC.davids@webmaster.com \
    --to=davids@webmaster.com \
    --cc=linux-kernel@vger.kernel.org \
    /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).