# Memory usage reported by varinfo()

**URL:** <https://discourse.julialang.org/t/memory-usage-reported-by-varinfo/26452>\
**Category:** New to Julia\
**Created:** [July 17, 2019, 7:10am UTC](https://discourse.julialang.org/t/memory-usage-reported-by-varinfo/26452 "2019-07-17T07:10:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sparrowhawk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sparrowhawk/32/9148_2.png) [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Post date:** [July 17, 2019, 7:10am UTC](https://discourse.julialang.org/t/memory-usage-reported-by-varinfo/26452/1 "2019-07-17T07:10:43Z")

</div>

Hi I understand that for a vector `a`

```julia
b = a

```

makes `b` refer to a

But this is my lack of understanding, why then does varinfo() show that `b` occupies the same amount of memory as `a`?

```julia
julia> a = ones(2)
2-element Array{Float64,1}:
 1.0
 1.0

julia> b = a
2-element Array{Float64,1}:
 1.0
 1.0

julia> InteractiveUtils.varinfo()
name size summary
---------------- ----------- --------------------------
Base Module
Core Module
InteractiveUtils 162.930 KiB Module
Main Module
a 56 bytes 2-element Array{Float64,1}
ans 56 bytes 2-element Array{Float64,1}
b 56 bytes 2-element Array{Float64,1}

```

---

<div class="post-metadata">

**Author:** ![kristoffer.carlsson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/kristoffer.carlsson/32/22_2.png) [@kristoffer.carlsson](https://discourse.julialang.org/u/kristoffer.carlsson)\
**Post date:** [July 17, 2019, 7:27am UTC](https://discourse.julialang.org/t/memory-usage-reported-by-varinfo/26452/2 "2019-07-17T07:27:59Z")

</div>

> [@sparrowhawk](#):
>
> makes `b` refer to a

This is not a correct understanding. Both `a` and `b` refer to the array that is stored somewhere in memory. `a` doesn’t own this array anymore than `b`. In fact, there is no way you can tell the difference between `a` and `b`.

This might be useful: [Converting a Matlab code into Julia - #18 by kristoffer.carlsson](https://discourse.julialang.org/t/converting-a-matlab-code-into-julia/12166/18)

---

<div class="post-metadata">

**Author:** ![sparrowhawk](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sparrowhawk/32/9148_2.png) [@sparrowhawk](https://discourse.julialang.org/u/sparrowhawk)\
**Post date:** [July 17, 2019, 7:42am UTC](https://discourse.julialang.org/t/memory-usage-reported-by-varinfo/26452/3 "2019-07-17T07:42:17Z")

</div>

Thanks, that’s what I suspected.

My confusion stems from the usage of the term ‘refer.’ To clarify the source of my confusion, if we use Futures (remote references) or DistributedArrays, then it is very clear from varinfo() that the data being distributed or referred to are not on the process that defines the DistributedArray or Future.
