Quote:
Originally Posted by jaewlee
I'm wondering what's the maximum heap space a process can use (not necessarily by a single malloc()) in Ubuntu x86_64. Which parameter determines the size?
|
You might get a better answer if you explain why you want to know.
For most purposes, the answer is "bigger than the practical limits".
If you plan to actually
use the heap space, you need your swap space plus a moderate fraction of your ram space to exceed the total heap allocation.
I'm not sure of the actual limits nor the parameters to tweak them, but I'm pretty sure that for any reasonable cost PC you won't have enough swap space to approach the limit before you exceed the practical limit.
If you want to allocate a lot of heap but not actually use it, so you want to be immune from the check that there is enough swap space, you can change the parameters controlling over commit checking.
Since no one is expected to hit the implemented limit before hitting a lower practical limit from swap size, I expect most Linux experts could not tell you the implemented limit.
The theoretical limit from the architecture would be nearly 128TB. Possibly, there is no Linux implementation detail cutting you short of that theoretical limit. So if you had 128TB of disk space and made it all into swap partitions, you could use 128TB of heap. Or maybe there are some limits on number of swap partitions and size of swap partitions that would leave you well short of 128TB even if you could attach that much disk space. I don't know those details.