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

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -