({{, (RefLink[MaxMemoryUsed, paclet:ref/MaxMemoryUsed])[]
gives the maximum number of bytes used to store all data for the current Wolfram System session.}, {, (RefLink[MaxMemoryUsed, paclet:ref/MaxMemoryUsed])[expr]
gives the maximum number of bytes used during the evaluation of expr.}})

OpenersNotesSection(Spacer1)Details

On most computer systems, (RefLink[MaxMemoryUsed, paclet:ref/MaxMemoryUsed])[] will give results close to those obtained from external process status requests.

(RefLink[MaxMemoryUsed, paclet:ref/MaxMemoryUsed])[] will not typically account for code space, stack space, or the effects of heap fragmentation.

OpenersPrimaryExamplesSection(Spacer1)Examples  (2)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Show the maximum memory used during a session:

MaxMemoryUsed[]

See how much the maximum memory used increased for a computation:

mmu = MaxMemoryUsed[];NDSolve[{D[u[t,x],t,t]==D[u[t,x],x,x]+Sin[u[t,x]],u[0,x]==Exp[-x^2],(D[u[t,x],t] /. t->0)==0,u[t,-10]==u[t,10]},u,{t,0,10},{x,-10,10}]

MaxMemoryUsed[]- mmu

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[MemoryInUse, paclet:ref/MemoryInUse])  ▪  (RefLink[ByteCount, paclet:ref/ByteCount])  ▪  (RefLink[MemoryAvailable, paclet:ref/MemoryAvailable])  ▪  (RefLink[MemoryConstrained, paclet:ref/MemoryConstrained])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Memory Management, paclet:tutorial/MemoryManagement])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Memory Measurement & Optimization, paclet:guide/MemoryMeasurementAndOptimization])}, {▪(RefLinkPlain[Wolfram System Session Information, paclet:guide/WolframSystemSessionInformation])}})}})