Memory size of DistributedArray



I’m trying to figure out the memory size of a DistributedArray. Consider the following example:

@everywhere using DistributedArrays
m = [rand(10,10) for i in 1:10]
d = distribute(m)

whos() indicates 168 bytes, but I suspect this is not the total memory consumption because whos() indicates m is 8080 bytes, which can also be obtained from sizeof(m) + sum(sizeof.(m)). I’m not sure if this would be correct for the DistributedArray, d. What is the best way to get the memory consumption of d without using whos()?


I want to follow up on this question to see if anyone might be able to help. My best guess is:

memory =  sizeof(d)
for a in d
    memory += sizeof(a)

totalMemory = Nprocs*memory

From what I can tell, the memory consumption on a single core is the size of the outer array plus the size of the inner arrays. It also looks like d is available on each processor. So the total memory is Nprocs*memory. Is this correct?

Thank you.