Getting OS memory size from java -
are there way size of total memory on operating system java? using
runtime.getruntime().maxmemory()
returns allowed memory jvm, not of operating system. have way obtain (from java code)?
com.sun.management.operatingsystemmxbean bean = (com.sun.management.operatingsystemmxbean) java.lang.management.managementfactory.getoperatingsystemmxbean(); long max = bean.gettotalphysicalmemorysize();
returns available ram size jvm (limited 32bit), not heap size.
Comments
Post a Comment