Runtime.FreeMemory Method

Definition

Returns the amount of free memory in the Java Virtual Machine.

[Android.Runtime.Register("freeMemory", "()J", "GetFreeMemoryHandler")]
public virtual long FreeMemory ();
[<Android.Runtime.Register("freeMemory", "()J", "GetFreeMemoryHandler")>]
abstract member FreeMemory : unit -> int64
override this.FreeMemory : unit -> int64

Returns

an approximation to the total amount of memory currently available for future allocated objects, measured in bytes.

Attributes

Remarks

Returns the amount of free memory in the Java Virtual Machine. Calling the gc method may result in increasing the value returned by freeMemory.

Java documentation for java.lang.Runtime.freeMemory().

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to