Runtime.TotalMemory Method

Definition

Returns the total amount of memory in the Java virtual machine.

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

Returns

the total amount of memory currently available for current and future objects, measured in bytes.

Attributes

Remarks

Returns the total amount of memory in the Java virtual machine. The value returned by this method may vary over time, depending on the host environment.

Note that the amount of memory required to hold an object of any given type may be implementation-dependent.

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

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