Anuj Troy wrote:need to write a command line java program to list all the available jvm's and list out their allocated heap memory and used heap memory. can someone give me a sample code.
Try Attach API, it gives you methods to view the available local jvm's along with their process id's
you can then attach to each jvm and use the java management extentions to get the information regarding the memory usage
you can connect to the platform MbeanServer on each jvm's if it already exists
else create one dynamically