I have a big 3D numpy array that is created inside my program as a product of two other arrays (ie it is not getting created after parsing a file on my disk). The array can have dimensions 250000-by-270-by-100 (or even bigger), hence the memory footprint is around 50GB since 250000 * 270 * 100 * 8 /(1024**3) = 50.3GB
The array is accessed multiple times until a chain has converged. Also, every loop of the chain mutates the array.
Depending on the memory installed on the pc that runs the code it may crash. I would definitely like to make that lighter in any case. Currently the quick fix is to change the datatype, from float64 to float32 for example.
Saving the array on the disk and then mmap()
it, maybe is an option but havent tried it because I think it will make it a lot slower.
Do you guys know what other options I have please? How can I handle an array that big? (maybe dask
but dont really know...)