当前位置: 首页>>代码示例>>Java>>正文


Java GcInfoCompositeData类代码示例

本文整理汇总了Java中sun.management.GcInfoCompositeData的典型用法代码示例。如果您正苦于以下问题:Java GcInfoCompositeData类的具体用法?Java GcInfoCompositeData怎么用?Java GcInfoCompositeData使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GcInfoCompositeData类属于sun.management包,在下文中一共展示了GcInfoCompositeData类的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: GcInfo

import sun.management.GcInfoCompositeData; //导入依赖的package包/类
private GcInfo(GcInfoBuilder builder,
               long index, long startTime, long endTime,
               MemoryUsage[] muBeforeGc,
               MemoryUsage[] muAfterGc,
               Object[] extAttributes) {
    this.builder       = builder;
    this.index         = index;
    this.startTime     = startTime;
    this.endTime       = endTime;
    String[] poolNames = builder.getPoolNames();
    this.usageBeforeGc = new HashMap<String, MemoryUsage>(poolNames.length);
    this.usageAfterGc = new HashMap<String, MemoryUsage>(poolNames.length);
    for (int i = 0; i < poolNames.length; i++) {
        this.usageBeforeGc.put(poolNames[i],  muBeforeGc[i]);
        this.usageAfterGc.put(poolNames[i],  muAfterGc[i]);
    }
    this.extAttributes = extAttributes;
    this.cdata = new GcInfoCompositeData(this, builder, extAttributes);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:20,代码来源:GcInfo.java

示例2: from

import sun.management.GcInfoCompositeData; //导入依赖的package包/类
/**
 * Returns a <tt>GcInfo</tt> object represented by the
 * given <tt>CompositeData</tt>. The given
 * <tt>CompositeData</tt> must contain
 * all the following attributes:
 *
 * <p>
 * <blockquote>
 * <table border>
 * <tr>
 *   <th align=left>Attribute Name</th>
 *   <th align=left>Type</th>
 * </tr>
 * <tr>
 *   <td>index</td>
 *   <td><tt>java.lang.Long</tt></td>
 * </tr>
 * <tr>
 *   <td>startTime</td>
 *   <td><tt>java.lang.Long</tt></td>
 * </tr>
 * <tr>
 *   <td>endTime</td>
 *   <td><tt>java.lang.Long</tt></td>
 * </tr>
 * <tr>
 *   <td>memoryUsageBeforeGc</td>
 *   <td><tt>javax.management.openmbean.TabularData</tt></td>
 * </tr>
 * <tr>
 *   <td>memoryUsageAfterGc</td>
 *   <td><tt>javax.management.openmbean.TabularData</tt></td>
 * </tr>
 * </table>
 * </blockquote>
 *
 * @throws IllegalArgumentException if <tt>cd</tt> does not
 *   represent a <tt>GcInfo</tt> object with the attributes
 *   described above.
 *
 * @return a <tt>GcInfo</tt> object represented by <tt>cd</tt>
 * if <tt>cd</tt> is not <tt>null</tt>; <tt>null</tt> otherwise.
 */
public static GcInfo from(CompositeData cd) {
    if (cd == null) {
        return null;
    }

    if (cd instanceof GcInfoCompositeData) {
        return ((GcInfoCompositeData) cd).getGcInfo();
    } else {
        return new GcInfo(cd);
    }

}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:56,代码来源:GcInfo.java


注:本文中的sun.management.GcInfoCompositeData类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。