Thomas Hruska <[EMAIL PROTECTED]> wrote: mano M wrote:
> Hi
>
> My program allocating 3 dimnsional array using malloc. My linux
> system has 2 GB ram and 50GB hard disk space.How much maximun space
> can I allocate using malloc?Is it maximum 2GB or more?will it swap
> memory,if allocate more the 2 GB?
>
> Thanks, Manoj
Manoj,
Well, under Linux you may be able to squeak out 4GB (may need to do some
root level stuff). However! If you really need that much RAM for an
extended period, consider using a Level 1-style cache (like CPUs have)
and your hard drive. You've got 50GB there.
Also, if your 3D array is "sparse", consider an alternate data structure
or a completely different approach (e.g. a BSP tree or related kin).
--
Thomas Hruska
CubicleSoft President
Ph: 517-803-4197
Typically, Linux does some form of overcomitting. That is, VM will ensure
malloc() success even if there isn't enough phy memory to back it.
You can encourage more overcomitting by increasing vm.overcommit_ratio (till
100) by "echo <value> > /proc/sys/vm/overcommit_ratio"
Also what is the value of /proc/sys/vm/overcommit_memory on your system?
Of course, all this matters only if are not going to actually write to a lot of
memory.
Regards,
Mohan S N
---------------------------------
Shape Yahoo! in your own image. Join our Network Research Panel today!
[Non-text portions of this message have been removed]