I have been working on one Java software project, which will be deployed to various hardware devices (e.g., raspberry pi, android phone).
Before releasing this project as product, I would like to guide users by clearly stating the minimum requirements (in terms of memory and CPU) or hardware device the user must have in order to run our software product.
How can I measure them? What are tools available for Java?
You may take help of jvisualvm path of this tool is Program Files\Java\jdk1.6.0_38\bin\jvisualvm.exe
You may use it to determine your cpu utilization and memory consumption.
As you can see your CPU utilization and memory utilization. Hope this tool may help you.
You can get the Total memory allotted to the JVM with:
Runtime.getRuntime().totalMemory();
and the Free memory(the unused memory allotted to the JVM) with:
Runtime.getRuntime().freeMemory();
So, to get the memory in use, you can subtract the free memory from the total memory.
So, you could do something like this:
long Total_Memory =Runtime.getRuntime().totalMemory();
long Free_Memory=Runtime.getRuntime().freeMemory();
long Memory =Total_Memory-Free_Memory;
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