Merge branch 'master' into dev

Conflicts:
	.gitignore
This commit is contained in:
fangshunjian
2019-01-11 10:51:10 +06:00
3 changed files with 9 additions and 4 deletions

4
.gitignore vendored
View File

@@ -1 +1,5 @@
<<<<<<< HEAD
/bin
=======
/bin/
>>>>>>> refs/heads/master

View File

@@ -1156,8 +1156,7 @@ public class ProcessUtil
*/
public static List<String> getLinuxProcessId(String procSearchKey)
{
String cmd = "ps -ef | grep -i '" + procSearchKey.trim()
+ "' | grep -v grep | awk '{print $2}'";
String cmd = "ps -ef | grep " + procSearchKey.trim() + " | grep -v grep | awk '{print $2}'";
logger.info("getLinuxProcessId-----" + cmd);
String[] shellCmd1 = new String[] { "/bin/bash", "-c", cmd };
BufferedReader bReader = null;

View File

@@ -190,8 +190,10 @@ public class SystemInfo
// a)物理内存信息
Mem mem = sigar.getMem();
Long memTotal = mem.getTotal();// 内存总量
Long memUsed = mem.getUsed();// 当前内存使用量
Long memFree = mem.getFree();// 当前内存剩余量
//Long memUsed = mem.getUsed();// 当前内存使用量
//Long memFree = mem.getFree();// 当前内存剩余量
Long memFree = mem.getActualFree();//
Long memUsed = mem.getActualUsed();
sb.append(doubleFormat(memTotal / (1024 * 1024 * 1024.0), 2));// 内存总量,单位:"G"
sb.append(SEPARATOR);
sb.append(doubleFormat(memUsed / (1024 * 1024 * 1024.0), 2));// 当前内存使用量,单位:"G"