Use the code to get information of memory usage at runtime.
Runtime runtime = Runtime.getRuntime();
long maxMemory = runtime.maxMemory();
long allocatedMemory = runtime.totalMemory();
long freeMemory = runtime.freeMemory();
Reference: http://stackoverflow.com/questions/74674/how-to-do-i-check-cpu-and-memory-usage-in-java
沒有留言:
張貼留言