Runtime.freeMemory

Class Overview | Class Members | This Package | All Packages

Syntax

public native long freeMemory()

Returns

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

Description

Returns the amount of free memory in the system. The value returned by this method is always less than the value returned by the totalMemory method. Calling the gc method may result in increasing the value returned by freeMemory.