4 ms·
For counts of things you have in memory, 32 bits is usually enough -- even if each thing is just 8 bytes, 2^32 of those objects would require 32 GB.
by duskwuff 10y ago
For counts of things you have in memory, 32 bits is usually enough -- even if each thing is just 8 bytes, 2^32 of those objects would require 32 GB.
- jandrese 10y ago32GB isn't an exceptional amount of memory these days.
- duskwuff 10y agoSure -- but it is an exceptional amount of memory to use for tiny objects like those. If you're working with four billion objects at a time, they're probably more substantial than eight bytes.
- detaro 10y agoOr you spent a lot of effort to get them to 8 bytes or even smaller, to fit as many of them as possible in memory. See use-cases like time-series/analytics databases, point-clouds, simulations with many elements...
- paulddraper 10y agoYou mean 4GB. And yes, 32-bit programs can't use more then 4GB.
- duskwuff 10y agoNo, I mean 32 GB -- 2^32 x 8 bytes. We're discussing 32-bit integers, not pointers.