Maximum amount of dynamic memory allocattion

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

 



Hi

I have a machine with 1 GB RAM and 1 GB swap area and it is a 32-bit machine.
For fun, I tried to allocate memory dynamically by using malloc in a loop till there is
no memory avilable. I ended up allocating 2 GB memory. My inference is, total memory
allocated can be equal to size of RAM + size of SWAP at max.

Afaik, for a 32 - bit machine we can not address more than 2^32 addresses. Now, If I
have another machine with 1 GB RAM and 4 GB swap then, as per above inference I
should be able to allocated 5 GB memory at max ! Out of this only lower 4 GB will be
addressable.

Is there some loophole in the above argument?

Regards,
Pharaoh.


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux