Memory Measurement & Optimization

 

ReferenceReference

ByteCount number of bytes used to store an expression

LeafCount number of "leaves" in an expression

Length  ▪  Depth  ▪  BitLength  ▪  Hash

Clear clear main values of a symbol

ClearAll clear all values and attributes

$HistoryLength number of previous outputs to store

$RecursionLimit  ▪  $IterationLimit  ▪  $MaxNumber  ▪  $MaxPrecision

MemoryConstrained abort a computation if it uses too much memory

MemoryInUse amount of memory currently in use

MaxMemoryUsed maximum memory used in this Wolfram Language kernel

Share internally share common subexpressions

FileByteCount size of an external file

Compress generate a compressed string representation of any expression

Uncompress recover an expression from its compressed string representation

Short display a shortened version of an expression

Low-Level Optimizations

Remove  ▪  ClearSystemCache  ▪  SystemOptions  ▪  SetSystemOptions