Memory Measurement & Optimization

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

MemoryAvailable estimated amount of additional memory available to this kernel

Share internally share common subexpressions

FileSize size of an external file

Compress generate a compressed string representation of any expression

Uncompress recover an expression from its compressed string representation

BinarySerialize  ▪  BinaryDeserialize

Short display a shortened version of an expression

Low-Level Optimizations

Remove  ▪  ClearSystemCache  ▪  SystemOptions  ▪  SetSystemOptions