I'd like to be able to get the size of the heap as a variable. I don't need to change the size, just know what it is and have it in a variable.
Thanks!
I haven't tried this before so I can't guarantee this will work, but try Runtime.totalMemory()
.
You can get application run time information
Runtime rt = Runtime.getRuntime();
rt.freeMemory();
rt.totalMemory();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With