Hi, In the Runtime example, it shows: maxmemory = rt.maxMemory(); totalmemory = rt.totalMemory();
System.out.println("Maximum amount of memory that the Java virtual machine will attempt to use = " + maxmemory + " bytes."); System.out.println("Total amount of memory currently available for current and future objects = " + totalmemory + " bytes. "); My output is: Maximum amount of memory that the Java virtual machine will attempt to use = 259522560 bytes. Total amount of memory currently available for current and future objects = 16252928 bytes. Questions: 1. maxmemory means that it is the maximum physical memory that JVM will use? 2. In the javadoc, it says, rt.totalMemory is the "returns the total amount of memory in the Java virtual machine", can you confirm that it is the available memory that JVM has available that it has not been used? 3. Is the amount of JVM memory use always close to the physical memory? For example, if I set the 256 Xmx in the heap size, does it mean it will use 256MB of physical memory in the system? 4. Is there any way I can find out what are allocation of objects that's using in the jvm? Thx. Lawrence -- To post to this group, send email to javaprogrammingwithpassion@googlegroups.com To unsubscribe from this group, send email to javaprogrammingwithpassion+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en