Find size of single object in memory

varinfo() accepts regular expressions to match object names, so you can use something like

x = rand(100, 100)
varinfo(r"x")

to get info on x. For the size in bytes use

Base.summarysize(x)

EDIT: Originally this answer recommended whos(), however as @Plankalkül mentions whos() has been renamed to varinfo(), the answer was updated accordingly.


You can use the sizeof function:

help?> sizeof
search: sizeof

  sizeof(s::AbstractString)

  The number of bytes in string s.

  sizeof(T)

  Size, in bytes, of the canonical binary representation of the given DataType T, if any.

julia> x = rand(100, 100);

julia> sizeof(x)
80000

Tags:

Julia