This is documentation for Mathematica 8, which was
based on an earlier version of the Wolfram Language.
View current documentation (Version 11.2)

MemoryInUse

MemoryInUse
gives the number of bytes currently being used to store all data in the current Mathematica kernel session.
MemoryInUse[$FrontEnd]
gives the number of bytes used in the Mathematica front end.
Current memory use in the kernel:
Storing a million elements of takes additional memory:
Current memory use in the front end:
Current memory use in the kernel:
In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Storing a million elements of takes additional memory:
In[3]:=
Click for copyable input
Out[3]=
 
Current memory use in the front end:
In[1]:=
Click for copyable input
Out[1]=
Even though there is no visible output, the result is still assigned to Out, so memory is used:
Add an expression after the to prevent the large result being assigned to Out:
New in 1 | Last modified in 6