MemoryInUse
MemoryInUse[] gives the number of bytes currently being used to store all data in the current Wolfram Language kernel session.
Examples
Check current memory usage:
MemoryInUse[]
(* 45678912 *)Monitor memory before and after:
before = MemoryInUse[];
data = Range[10^6];
after = MemoryInUse[];
after - before
(* Bytes used by data *)Please visit the official Wolfram Language Reference for more details.