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.
Returns:
the total amount of memory currently available for current and future objects, measured in bytes.
Returns the amount of free memory in the system. Calling the gc method may result in increasing the value returned by freeMemory.
Returns:
an approximation to the total amount of memory currently available for future allocated objects, measured in bytes.