summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfangshunjian <[email protected]>2019-01-11 12:26:45 +0600
committerfangshunjian <[email protected]>2019-01-11 12:26:45 +0600
commit3d258f645f572bde3167ae8baf48a1fa9f7c649a (patch)
tree44327db1de6234410e721619784a550b170d817c
parent492050c0ea7a2c3a1ccb10433af23494094ab79a (diff)
1、修改内存利用率获取方式k18-1.0
-rw-r--r--src/com/nis/systeminfo/model/SystemInfo.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/com/nis/systeminfo/model/SystemInfo.java b/src/com/nis/systeminfo/model/SystemInfo.java
index c628971..690dc72 100644
--- a/src/com/nis/systeminfo/model/SystemInfo.java
+++ b/src/com/nis/systeminfo/model/SystemInfo.java
@@ -200,7 +200,8 @@ public class SystemInfo
sb.append(SEPARATOR);
sb.append(doubleFormat(memFree / (1024 * 1024 * 1024.0), 2));// 当前内存剩余量,单位:"G"
sb.append(SEPARATOR);
- sb.append(doubleFormat(((memTotal - memFree) * 100.0) / memTotal, 1));// 内存使用率
+ sb.append(doubleFormat(mem.getUsedPercent(), 1));// 内存使用率
+// sb.append(doubleFormat(((memTotal - memFree) * 100.0) / memTotal, 1));// 内存使用率
StringBuffer sb2 = new StringBuffer();
// sb2.append("内存总大小: " + doubleFormat(memTotal / (1024 * 1024 * 1024.0), 2) + "G, 现使用:"
@@ -210,7 +211,7 @@ public class SystemInfo
sb2.append("i18n_client.SystemInfo.memerySize_n81i: " + doubleFormat(memTotal / (1024 * 1024 * 1024.0), 2) + "G, i18n_client.SystemInfo.currentUsed_n81i:"
+ doubleFormat(memUsed / (1024 * 1024 * 1024.0), 2) + "G, i18n_client.SystemInfo.spaceRemain_n81i:"
+ doubleFormat(memFree / (1024 * 1024 * 1024.0), 2) + "G, i18n_client.SystemInfo.shiyonglv_n81i:"
- + doubleFormat(((memTotal - memFree) * 100.0) / memTotal, 1) + "%");
+ + doubleFormat(mem.getUsedPercent(), 1) + "%");
detectInfo.getDetailDatas().add(sb.toString());
detectInfo.setDescInfo(sb2.toString());