Re: Is malloc allocating memory on the virtual memory space ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Cesar,

> Is there a way in C to allocate on VM only so the process address space (1G)
> is not touched (or barely touched). Thanks a lot for your help

For both platforms -- Windows NT (3.1, 3.5, 4.0, 2000, XP, Vista) and HP-UX
11 -- VM usage is automatic.

You can make it explicit using memory mapped files.

But that won't address your problem.

The problem is that you are allocating more space than is accessible in a
32-bit address space.

You either need 64-bit address space, or you need to partition your problem
so that only a portion is in memory and the bulk of the data resides in
files.

Imagine, for example, that of your 656000 rows (each of which contains a
columnar string of 141 elements), only 2 can be loaded in memory
concurrently.  Load 'em up, change them & mark that string as dirty, write
the dirty strings back to the working data file (temporary or persistent, as
per your needs).

HTH,
--Eljay


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux