({{, (RefLink[MemoryInUse, paclet:ref/MemoryInUse])[]
gives the number of bytes currently being used to store all data in the current Wolfram Language kernel session. }, {, (RefLink[MemoryInUse, paclet:ref/MemoryInUse])[(RefLink[$FrontEnd, paclet:ref/$FrontEnd])] 
gives the number of bytes used in the Wolfram System front end.}})

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Current memory use in the kernel:

MemoryInUse[]

t=Range[10^6];

Storing a million elements of t takes additional memory:

MemoryInUse[]

Current memory use in the front end:

MemoryInUse[$FrontEnd]

OpenersExampleSection1(Spacer1)Possible Issues  (1)

MemoryInUse[]

Range[10^6];

Even though there is no visible output, the result is still assigned to (RefLink[Out, paclet:ref/Out])[2], so memory is used:

MemoryInUse[]

Add an expression after the ; to prevent the large result being assigned to (RefLink[Out, paclet:ref/Out])[4]:

Range[10^6];None

MemoryInUse[]

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

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

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