add a method to detect the memory of JVM