Free Memory In Java Example

Chapter: Run Time Last Updated: 09-07-2016 05:26:43 UTC

Program:

            /* ............... START ............... */
                
public class JavaFreeMemory {
	public static void main(String[] args) {

		System.out.println("Free Memory  : " + Runtime.getRuntime().freeMemory());

	}
}
                /* ............... END ............... */
        

Output

Free Memory  : 63480592

Notes:

  • freeMemory() returns the amount of free memory in the Java Virtual Machine. Calling the gc method may result in increasing the value returned by freeMemory.
  • Syntax : public long freeMemory().

Tags

Free Memory, Java

Similar Programs Chapter Last Updated
System Time Milliseconds In Java Example Run Time 17-06-2016
File Separator Using System Class Run Time 17-06-2016
Java Virtual Machine (JVM) Termination Example Run Time 17-06-2016
JVM to Run Garbage Collector Example Run Time 17-06-2016
Total Memory Java Virtual Machine (JVM) Example Run Time 17-06-2016
Java RunTime Example Run Time 17-06-2016
Available Processors Using Java Runtime Run Time 06-04-2016
Maximum Memory Available to Java Virtual Machine(JVM) Run Time 09-07-2016

1