News for hackers. Stuff that matters.
Re:Malloc Never Fails (2012) by em3rgent0rdr on Monday June 10, 2019 @04:43AM (#20144933)
Malloc allocates virtual memory. The original article had to issue a correction at the end: "I was wrong about why malloc finally failed! @GodmarBack observes, in the comments, that x64 systems only have an address space of 48 bits, which comes out to about 131000 GB. So, on my machine at least, the malloc finally failed because of address space exhaustion."
Re:Malloc Never Fails (2012) by metrxqin on Monday June 10, 2019 @05:22AM (#20145107)
That's incorrect, 2^48 bits = 262144GB actually.
Re:Malloc Never Fails (2012) by unilynx on Monday June 10, 2019 @05:29AM (#20145133)
They forgot to mention the kernel gets the top half of the address space, leaving 2^47 for the process. And then it mostly adds up.
Re:Malloc Never Fails (2012) by lifthrasiir on Monday June 10, 2019 @05:28AM (#20145128)
But x86-64 divides the 48-bit address space into two halves, only one of which is available in the user mode.
Re:Malloc Never Fails (2012) by monocasa on Monday June 10, 2019 @01:14PM (#20148686)
To be fair, there's nothing that says the higher half _has_ to be entirely kernel mode. Only that bits 63 through 48 have to be the same value.

And Intel has a spec out for a PML5 page table, giving you 57 total virtual address bits.