I have a compiled function cfun
that produces a very large array of data. I learned that compiled functions automatically use PackedArrays. I just wonder whether there is a more efficient way in Mathematica to store large arrays of numerical data.
Is there somewhere a table where I can see how much memory a PackedArray consisting of numerical data with MachineSize precision should consume?
For an output array of length 10^8 ByteCount[]
returns memory consumption of 1.6 GB on my machine. Would be great if somebody could tell me whether this is a normal value and whether there is a way to store the array in a more efficient way (since for the purpose of my program I need to store a list of length 10^9-10^10 which would correspond to 16-160 GB RAM).
Openwrite
,Write
etc? Or create an enourmous (~100gb) swap file, like I did today?$\endgroup$SeedRandom
to generate the data and to retrieve it later without storing the actual pseudorandom numbers.$\endgroup$