# Memory size of DistributedArray

**URL:** <https://discourse.julialang.org/t/memory-size-of-distributedarray/8085>\
**Category:** General Usage\
**Tags:** question\
**Created:** [January 1, 2018, 12:26am UTC](https://discourse.julialang.org/t/memory-size-of-distributedarray/8085 "2018-01-01T00:26:51Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [January 1, 2018, 12:26am UTC](https://discourse.julialang.org/t/memory-size-of-distributedarray/8085/1 "2018-01-01T00:26:51Z")

</div>

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

```julia
addprocs(2)
@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()`?

---

<div class="post-metadata">

**Author:** ![Christopher\_Fisher](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/christopher_fisher/32/26132_2.png) [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Post date:** [January 24, 2018, 2:49pm UTC](https://discourse.julialang.org/t/memory-size-of-distributedarray/8085/2 "2018-01-24T14:49:27Z")

</div>

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

```julia
memory = sizeof(d)
for a in d
    memory += sizeof(a)
end

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.
