/Engine/Source/Runtime/Core/Public/HAL/MemoryMisc.h
This will grab the memory stats of VM and Physical before and at the end of scope reporting +/- difference in memory. WARNING This will also capture differences in Threads which have nothing to do with the scope
class FScopedMemoryStats