summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew John Hughes <gnu_andrew@member.fsf.org>2006-07-22 19:59:12 +0000
committerAndrew John Hughes <gnu_andrew@member.fsf.org>2006-07-22 19:59:12 +0000
commitf4aada78b313b1148dfa018f3557d3030acc5efd (patch)
tree5f92bb484074f76f41000ca1f558a00ecbe29e67
parent117a7978539cb6f9ddd0bd483979970b532ed899 (diff)
downloadclasspath-f4aada78b313b1148dfa018f3557d3030acc5efd.tar.gz
2006-07-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
* doc/vmintegration.texinfo: Document getType(String). * gnu/java/lang/management/MemoryPoolMXBeanImpl.java, * java/lang/management/MemoryPoolMXBean.java: (getType()): Implemented. * vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java (getType(String)): Implemented.
-rw-r--r--ChangeLog10
-rw-r--r--doc/vmintegration.texinfo3
-rw-r--r--gnu/java/lang/management/MemoryPoolMXBeanImpl.java5
-rw-r--r--java/lang/management/MemoryPoolMXBean.java8
-rw-r--r--vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java9
5 files changed, 35 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 6a5266556..a164fed7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,16 @@
2006-07-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
* doc/vmintegration.texinfo:
+ Document getType(String).
+ * gnu/java/lang/management/MemoryPoolMXBeanImpl.java,
+ * java/lang/management/MemoryPoolMXBean.java:
+ (getType()): Implemented.
+ * vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java
+ (getType(String)): Implemented.
+
+2006-07-22 Andrew John Hughes <gnu_andrew@member.fsf.org>
+
+ * doc/vmintegration.texinfo:
Move end of itemization block.
2006-07-22 Robert Schuster <robertschuster@fsfe.org>
diff --git a/doc/vmintegration.texinfo b/doc/vmintegration.texinfo
index f288b435f..e7f85d088 100644
--- a/doc/vmintegration.texinfo
+++ b/doc/vmintegration.texinfo
@@ -1551,6 +1551,9 @@ of names of memory managers which manage the specified pool.
@item @code{(getPeakUsage(String))} -- Returns a
@code{java.lang.management.MemoryUsage} object for the peak
usage level of the specified pool.
+@item @code{(getType(String))} -- Returns a string containing
+either @code{"HEAP"} or @code{"NON_HEAP"} which indicates the type of
+memory used by the specified pool.
@item @code{(getUsage(String))} -- Returns a
@code{java.lang.management.MemoryUsage} object for the current
usage level of the specified pool.
diff --git a/gnu/java/lang/management/MemoryPoolMXBeanImpl.java b/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
index af718e3ff..9554aae00 100644
--- a/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
+++ b/gnu/java/lang/management/MemoryPoolMXBeanImpl.java
@@ -125,6 +125,11 @@ public final class MemoryPoolMXBeanImpl
return null;
}
+ public String getType()
+ {
+ return VMMemoryPoolMXBeanImpl.getType(name);
+ }
+
public MemoryUsage getUsage()
{
if (isValid())
diff --git a/java/lang/management/MemoryPoolMXBean.java b/java/lang/management/MemoryPoolMXBean.java
index 29b438c29..5b04c64d3 100644
--- a/java/lang/management/MemoryPoolMXBean.java
+++ b/java/lang/management/MemoryPoolMXBean.java
@@ -157,6 +157,14 @@ public interface MemoryPoolMXBean
MemoryUsage getPeakUsage();
/**
+ * Returns the type of memory used by this pool. This can be
+ * either heap or non-heap memory.
+ *
+ * @return the type of this pool.
+ */
+ String getType();
+
+ /**
* Returns memory usage statistics for the current memory usage
* of the pool. The return value may be <code>null</code> if
* this pool is no longer valid. Obtaining these values is
diff --git a/vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java b/vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java
index e32e8f0ac..723d4e897 100644
--- a/vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java
+++ b/vm/reference/gnu/java/lang/management/VMMemoryPoolMXBeanImpl.java
@@ -106,6 +106,15 @@ final class VMMemoryPoolMXBeanImpl
static native MemoryUsage getPeakUsage(String name);
/**
+ * Returns the type of memory used by the specified pool.
+ * The value must be either "HEAP" or "NON_HEAP".
+ *
+ * @param name the name of the pool to obtain statistics on.
+ * @return the type of the given pool.
+ */
+ static native String getType(String name);
+
+ /**
* Returns the current usage level of the specified pool.
* This is only called if the pool is valid.
*