diff --git a/apps/routerconsole/java/build.xml b/apps/routerconsole/java/build.xml index b59a4413ccc4080c16dbb560e0a23fee84867a7c..94de8d185a6da9c88f1565d182afecefc5896c1d 100644 --- a/apps/routerconsole/java/build.xml +++ b/apps/routerconsole/java/build.xml @@ -28,10 +28,13 @@ </target> <target name="war" depends="precompilejsp"> <war destfile="build/routerconsole.war" webxml="../jsp/web-out.xml" - basedir="../jsp/" excludes="web.xml, *.java, *.jsp"> + basedir="../jsp/" excludes="web.xml, *.java, *.jsp, web-fragment.xml"> </war> </target> <target name="precompilejsp"> + <delete dir="../jsp/WEB-INF/" /> + <delete dir="../jsp/web-fragment.xml" /> + <delete dir="../jsp/web-out.xml" /> <mkdir dir="../jsp/WEB-INF/" /> <mkdir dir="../jsp/WEB-INF/classes" /> <!-- there are various jspc ant tasks, but they all seem a bit flakey --> diff --git a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java index 9583aaff0a7171d7951efea32b3fbb3023265519..50ac4ca88196d5afd7c257f30919040ec8ab26f0 100644 --- a/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java +++ b/apps/routerconsole/java/src/net/i2p/router/web/SummaryHelper.java @@ -64,6 +64,17 @@ public class SummaryHelper { else return DataHelper.formatDuration(router.getUptime()); } + + + /** + * Retrieve amount of used memory. + * + */ + public String getMemory() { + long used = (Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory())/1024; + long usedPc = 100 - ((Runtime.getRuntime().freeMemory() * 100) / Runtime.getRuntime().totalMemory()); + return used + "KB (" + usedPc + "%)"; + } /** * How many active peers the router has. diff --git a/apps/routerconsole/jsp/summary.jsp b/apps/routerconsole/jsp/summary.jsp index 64cda9550a09e111fdf216d5192766e166cd98b6..c0d5103fa14e3b7cb10234c5a2ee054316ffab51 100644 --- a/apps/routerconsole/jsp/summary.jsp +++ b/apps/routerconsole/jsp/summary.jsp @@ -7,6 +7,7 @@ <b>Ident:</b> <jsp:getProperty name="helper" property="ident" /><br /> <b>Version:</b> <jsp:getProperty name="helper" property="version" /><br /> <b>Uptime:</b> <jsp:getProperty name="helper" property="uptime" /><br /> + <b>Memory:</b> <jsp:getProperty name="helper" property="memory" /><br /> <hr /> <u><b>Peers</b></u><br />