In this section, we are going to illustrates you how to obtain the heap size. The heap is the area in the memory used for memory storage during the runtime of the program.
getRuntime()- This method returns the runtime object of the current Java application.
totalMemory() - This method returns the total amount of memory in the JVM.
Here is the code of GetHeapSize.java
Output will be displayed as:
Rs. 20,000 US$ 300
Today: Rs. 10,000 US$150
Course Duration: 30 hrs
Posted on: November 1, 2008 If you enjoyed this post then why not add us on Google+? Add us to your Circles