Click or drag to resize
GCGetTotalMemory Method
Retrieves the number of bytes currently thought to be allocated. A parameter indicates whether this method can wait a short interval before returning, to allow the system to collect garbage and finalize objects.

Namespace: System
Assembly: mscorlib (in mscorlib.dll) Version: 4.0.0.0
Syntax
C#
public static long GetTotalMemory(
	bool forceFullCollection
)

Parameters

forceFullCollection
Type: SystemBoolean
true to indicate that this method can wait for garbage collection to occur before returning; otherwise, false.

Return Value

Type: Int64
A number that is the best available approximation of the number of bytes currently allocated in managed memory.
See Also