<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
Java获得当前系统内存情况的代码如下:
ManagementFactory.getOperatingSystemMXBean()返回的是java.lang.management里面的peratingSystemMXBean ;
我们要用的是com.sun.management.OperatingSystemMXBean;
在java类库中可以查到:
public abstract Interface com.sun.management.OperatingSystemMXBean extends java.lang.management.OperatingSystemMXBean ,所以我们可以强制转换一下。
硬盘使用:
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
<script type="text/javascript"> </script> <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"></script>
<script src="http://www.google.com/reader/ui/publisher.js" type="text/javascript"></script> <script src="http://www.google.com/reader/public/javascript/user/00697638153916680411/state/com.google/broadcast?n=5&callback=GRC_p(%7Bc%3A%22green%22%2Ct%3A%22%5Cu8FD9%5Cu4E9B%5Cu6587%5Cu7AE0%5Cu4E5F%5Cu503C%5Cu5F97%5Cu4E00%5Cu770B%22%2Cs%3A%22false%22%7D)%3Bnew%20GRC" type="text/javascript"></script>