|
Java™ by example!
|
|
|
How do I determine the amount of memory available?
Try the Runtime class. It contains the methods totalMemory and freeMemory. totalMemory returns the total amount of memory available to the Virtual Machine.
Output in my case:
To change the amount of total heap memory available, you can specify so as an argument to Java:
Outputs:
Further Information
Author of answer: Joris Van den Bogaert
Comments to this answer are only viewable by members. Login or become a member!
|
|
|
|
|