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]:

Wolfram Research (1988), MemoryInUse, Wolfram Language function, https://reference.wolfram.com/language/ref/MemoryInUse.html (updated 2007).

Text

Wolfram Research (1988), MemoryInUse, Wolfram Language function, https://reference.wolfram.com/language/ref/MemoryInUse.html (updated 2007).

CMS

Wolfram Language. 1988. "MemoryInUse." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2007. https://reference.wolfram.com/language/ref/MemoryInUse.html.

APA

Wolfram Language. (1988). MemoryInUse. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/MemoryInUse.html

BibTeX

@misc{reference.wolfram_2024_memoryinuse, author="Wolfram Research", title="{MemoryInUse}", year="2007", howpublished="\url{https://reference.wolfram.com/language/ref/MemoryInUse.html}", note=[Accessed: 23-November-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_memoryinuse, organization={Wolfram Research}, title={MemoryInUse}, year={2007}, url={https://reference.wolfram.com/language/ref/MemoryInUse.html}, note=[Accessed: 23-November-2024 ]}