Permalink
Browse files

no message

  • Loading branch information...
1 parent 8e65981 commit 9526fcbe27467bfe7d435809cfc315e3e60de701 Bela Ban committed May 19, 2004
Showing with 15 additions and 3 deletions.
  1. +15 −3 src/org/jgroups/util/Util.java
@@ -1,4 +1,4 @@
-// $Id: Util.java,v 1.9 2004/05/17 18:28:54 belaban Exp $
+// $Id: Util.java,v 1.10 2004/05/19 00:32:32 belaban Exp $
package org.jgroups.util;
@@ -210,8 +210,6 @@ public static String printEvent(Event evt) {
/** Tries to read an object from the message's buffer and prints it */
public static String printMessage(Message msg) {
- Object obj;
-
if(msg == null)
return "";
if(msg.getLength() == 0)
@@ -770,6 +768,20 @@ public static void prompt(String s) {
}
}
+ public static String memStats(boolean gc) {
+ StringBuffer sb=new StringBuffer();
+ Runtime rt=Runtime.getRuntime();
+ if(gc)
+ rt.gc();
+ long free_mem, total_mem, used_mem;
+ free_mem=rt.freeMemory();
+ total_mem=rt.totalMemory();
+ used_mem=total_mem - free_mem;
+ sb.append("Free mem: ").append(free_mem).append("\nUsed mem: ").append(used_mem);
+ sb.append("\nTotal mem: ").append(total_mem);
+ return sb.toString();
+ }
+
/*
public static void main(String[] args) {

0 comments on commit 9526fcb

Please sign in to comment.