diff --git a/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java b/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java index 42588201008..090f7e36c3b 100644 --- a/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java +++ b/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java @@ -85,9 +85,9 @@ public static List list() { // Get memory information. Runtime runtime = Runtime.getRuntime(); int mb = 1024 * 1024; - put(l, "os.memory.free", runtime.freeMemory() / mb + "MB"); - put(l, "os.memory.max", runtime.maxMemory() / mb + "MB"); - put(l, "os.memory.total", runtime.totalMemory() / mb + "MB"); + put(l, "jvm.memory.free", runtime.freeMemory() / mb + "MB"); + put(l, "jvm.memory.max", runtime.maxMemory() / mb + "MB"); + put(l, "jvm.memory.total", runtime.totalMemory() / mb + "MB"); return l; } diff --git a/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java b/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java index 93c318787a1..ef8448dd418 100644 --- a/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java +++ b/zookeeper-server/src/test/java/org/apache/zookeeper/server/admin/CommandsTest.java @@ -155,7 +155,7 @@ public void testDump() throws IOException, InterruptedException { @Test public void testEnvironment() throws IOException, InterruptedException { - testCommand("environment", new Field("zookeeper.version", String.class), new Field("host.name", String.class), new Field("java.version", String.class), new Field("java.vendor", String.class), new Field("java.home", String.class), new Field("java.class.path", String.class), new Field("java.library.path", String.class), new Field("java.io.tmpdir", String.class), new Field("java.compiler", String.class), new Field("os.name", String.class), new Field("os.arch", String.class), new Field("os.version", String.class), new Field("user.name", String.class), new Field("user.home", String.class), new Field("user.dir", String.class), new Field("os.memory.free", String.class), new Field("os.memory.max", String.class), new Field("os.memory.total", String.class)); + testCommand("environment", new Field("zookeeper.version", String.class), new Field("host.name", String.class), new Field("java.version", String.class), new Field("java.vendor", String.class), new Field("java.home", String.class), new Field("java.class.path", String.class), new Field("java.library.path", String.class), new Field("java.io.tmpdir", String.class), new Field("java.compiler", String.class), new Field("os.name", String.class), new Field("os.arch", String.class), new Field("os.version", String.class), new Field("user.name", String.class), new Field("user.home", String.class), new Field("user.dir", String.class), new Field("jvm.memory.free", String.class), new Field("jvm.memory.max", String.class), new Field("jvm.memory.total", String.class)); } @Test