memorynotificationinfo.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 452 行 · 第 1/2 页

HTML
452
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!--NewPage--><HTML><HEAD><!-- Generated by javadoc (build 1.5.0_03) on Wed Nov 02 09:50:14 CST 2005 --><META http-equiv="Content-Type" content="text/html; charset=gb2312"><TITLE>MemoryNotificationInfo (Java 2 Platform SE 5.0)</TITLE><META NAME="keywords" CONTENT="java.lang.management.MemoryNotificationInfo class"><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style"><SCRIPT type="text/javascript">function windowTitle(){    parent.document.title="MemoryNotificationInfo (Java 2 Platform SE 5.0)";}</SCRIPT><NOSCRIPT></NOSCRIPT></HEAD><BODY BGCOLOR="white" onload="windowTitle();"><!-- ========= START OF TOP NAVBAR ======= --><A NAME="navbar_top"><!-- --></A><A HREF="#skip-navbar_top" title="跳过导航链接"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_top_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">  <TR ALIGN="center" VALIGN="top">  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>概述</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>软件包</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>类</B></FONT>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MemoryNotificationInfo.html"><FONT CLASS="NavBarFont1"><B>使用</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>树</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>已过时</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>索引</B></FONT></A>&nbsp;</TD>  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>帮助</B></FONT></A>&nbsp;</TD>  </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup>&nbsp;2&nbsp;Platform<br>Standard&nbsp;Ed. 5.0</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">&nbsp;<A HREF="MemoryMXBean.html" title="java.lang.management 中的接口"><B>上一个类</B></A>&nbsp;&nbsp;<A HREF="MemoryPoolMXBean.html" title="java.lang.management 中的接口"><B>下一个类</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">  <A HREF="../../../index.html@java_2Flang_2Fmanagement_2FMemoryNotificationInfo.html" target="_top"><B>框架</B></A>  &nbsp;&nbsp;<A HREF="MemoryNotificationInfo.html" target="_top"><B>无框架</B></A>  &nbsp;&nbsp;<SCRIPT type="text/javascript">  <!--  if(window==top) {    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>所有类</B></A>');  }  //--></SCRIPT><NOSCRIPT>  <A HREF="../../../allclasses-noframe.html"><B>所有类</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">  摘要:&nbsp;嵌套&nbsp;|&nbsp;<A HREF="#field_summary">字段</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">构造方法</A>&nbsp;|&nbsp;<A HREF="#method_summary">方法</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">详细信息:&nbsp;<A HREF="#field_detail">字段</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">构造方法</A>&nbsp;|&nbsp;<A HREF="#method_detail">方法</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_top"></A><!-- ========= END OF TOP NAVBAR ========= --><HR><!-- ======== START OF CLASS DATA ======== --><H2><FONT SIZE="-1">java.lang.management</FONT><BR>类 MemoryNotificationInfo</H2><PRE><A HREF="../Object.html" title="java.lang 中的类">java.lang.Object</A>  <IMG SRC="../../../resources/inherit.gif" ALT="继承者 "><B>java.lang.management.MemoryNotificationInfo</B></PRE><HR><DL><DT><PRE>public class <B>MemoryNotificationInfo</B><DT>extends <A HREF="../Object.html" title="java.lang 中的类">Object</A></DL></PRE><P>关于内存通知的信息。<p>当 Java 虚拟机检测到内存池的内存使用量超过了阈值时,<A HREF="MemoryMXBean.html" title="java.lang.management 中的接口"><CODE>MemoryMXBean</CODE></A> 将发出内存通知。发出的通知将包含关于检测到的情况的内存通知信息:<ul>  <li>内存池的名称。</li>  <li>构造通知时内存池的内存使用量。</li>  <li>构造通知时,内存使用量超过阈值的次数。对于使用量阈值通知,此计数将为<A HREF="MemoryPoolMXBean.html#getUsageThresholdCount()"><CODE>使用量阈值计数</CODE></A>。对于集合使用量阈值通知,此计数将为<A HREF="MemoryPoolMXBean.html#getCollectionUsageThresholdCount()"><CODE>集合使用量阈值计数</CODE></A>。       </li></ul><p>表示 <tt>MemoryNotificationInfo</tt> 对象的 <CODE>CompositeData</CODE> 存储在<CODE>通知</CODE>的<CODE>用户数据</CODE>中。提供了<A HREF="MemoryNotificationInfo.html#from(javax.management.openmbean.CompositeData)"><CODE>表单</CODE></A>方法将 <tt>CompositeData</tt> 转换为 <tt>MemoryNotificationInfo</tt> 对象。例如: <blockquote><pre>      Notification notif;      // receive the notification emitted by MemoryMXBean and set to notif      ...                  String notifType = notif.getType();      if (notifType.equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED) ||          notifType.equals(MemoryNotificationInfo.MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {          // retrieve the memory notification information          CompositeData cd = (CompositeData) notif.getUserData();          MemoryNotificationInfo info = MemoryNotificationInfo.from(cd);          ....      }   </pre></blockquote><p><tt>MemoryMXBean</tt> 发出的通知类型为:<ul>   <li><A HREF="MemoryNotificationInfo.html#MEMORY_THRESHOLD_EXCEEDED"><CODE>使用量阈值超过通知</CODE></A>。<br>当内存池的内存使用量增加,达到或超过其<a href="MemoryPoolMXBean#UsageThreshold">使用量阈值</a>,将发出此通知。后续的使用量阈值超过情况不会导致更多的通知,一直到内存使用量返回到小于使用量阈值的状态为止。       <p></li>  <li><A HREF="MemoryNotificationInfo.html#MEMORY_COLLECTION_THRESHOLD_EXCEEDED"><CODE>集合使用量阈值超过通知</CODE></A>。<br>当 Java 虚拟机对内存池中不使用的对象进行了回收工作之后,内存池的内存使用量大于或等于其<a href="MemoryPoolMXBean#CollectionThreshold">集合使用量阈值</a>时,将发出此通知。</li>  </ul><P><P><DL><DT><B>从以下版本开始:</B></DT>  <DD>1.5</DD></DL><HR><P><!-- =========== FIELD SUMMARY =========== --><A NAME="field_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>字段摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../String.html" title="java.lang 中的类">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="MemoryNotificationInfo.html#MEMORY_COLLECTION_THRESHOLD_EXCEEDED">MEMORY_COLLECTION_THRESHOLD_EXCEEDED</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;表示当 Java 虚拟机对内存池中的不使用的对象进行了回收工作之后,内存池的内存使用量大于或等于其<a href="MemoryPoolMXBean#CollectionThreshold">集合使用量阈值</a>的通知类型。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="../String.html" title="java.lang 中的类">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="MemoryNotificationInfo.html#MEMORY_THRESHOLD_EXCEEDED">MEMORY_THRESHOLD_EXCEEDED</A></B></CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;表示内存池的内存使用量已达到或超过其<a href="MemoryPoolMXBean#UsageThreshold">使用量阈值</a>的通知类型。</TD></TR></TABLE>&nbsp;<!-- ======== CONSTRUCTOR SUMMARY ======== --><A NAME="constructor_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>构造方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><B><A HREF="MemoryNotificationInfo.html#MemoryNotificationInfo(java.lang.String, java.lang.management.MemoryUsage, long)">MemoryNotificationInfo</A></B>(<A HREF="../String.html" title="java.lang 中的类">String</A>&nbsp;poolName,                       <A HREF="MemoryUsage.html" title="java.lang.management 中的类">MemoryUsage</A>&nbsp;usage,                       long&nbsp;count)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;构造一个 <tt>MemoryNotificationInfo</tt> 对象。</TD></TR></TABLE>&nbsp;<!-- ========== METHOD SUMMARY =========== --><A NAME="method_summary"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2"><B>方法摘要</B></FONT></TH></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="MemoryNotificationInfo.html" title="java.lang.management 中的类">MemoryNotificationInfo</A></CODE></FONT></TD><TD><CODE><B><A HREF="MemoryNotificationInfo.html#from(javax.management.openmbean.CompositeData)">from</A></B>(javax.management.openmbean.CompositeData&nbsp;cd)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回由给定 <tt>CompositeData</tt> 表示的 <tt>MemoryNotificationInfo</tt> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="MemoryNotificationInfo.html#getCount()">getCount</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回构造通知时内存使用量超过阈值的次数。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="../String.html" title="java.lang 中的类">String</A></CODE></FONT></TD><TD><CODE><B><A HREF="MemoryNotificationInfo.html#getPoolName()">getPoolName</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回触发此通知的内存池的名称。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?