devxlogo

Determine How Much Memory Is Available for Your Application

Determine How Much Memory Is Available for Your Application

You can get the amount of free memory in your JVM as follows:

 Runtime rt = Runtime.getRuntime();long free = rt.freeMemory();

You can also get the total memory using the totalMemory() method of the same class java.lang.Runtime.

devx-admin

Share the Post: