MemoryInUse

MemoryInUse[]

gives the number of bytes currently being used to store all data in the current Wolfram Language kernel session.

MemoryInUse[$FrontEnd]

gives the number of bytes used in the Wolfram System front end.

Examples

open allclose all

Basic Examples  (2)

Current memory use in the kernel:

Storing a million elements of t takes additional memory:

Current memory use in the front end:

Possible Issues  (1)

Even though there is no visible output, the result is still assigned to Out[2], so memory is used:

Add an expression after the ; to prevent the large result being assigned to Out[4]:

Introduced in 1988
 (1.0)
 |
Updated in 2007
 (6.0)