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

Documentation / Mathematica / Built-in Functions / System Interface / Memory Usage /

LeafCount

FilledSmallSquare LeafCount[expr] gives the total number of indivisible subexpressions in expr.

FilledSmallSquare LeafCount gives a measure of the total "size" of an expression.

FilledSmallSquare LeafCount counts the number of subexpressions in expr which correspond to "leaves" on the expression tree.

FilledSmallSquare Example: LeafCount[1 + a + b^2] LongRightArrow.

FilledSmallSquare LeafCount is based on FullForm representation of expressions.

FilledSmallSquare Numbers with heads Rational and Complex are treated as composite objects, just as in FullForm.

FilledSmallSquare See Section 2.14.4.

FilledSmallSquare See also: ByteCount, Length, Depth, AtomQ.

FilledSmallSquare New in Version 1.

Further Examples