Package java.lang.management

Examples of java.lang.management.MemoryType


        List<MemoryPoolMXBean> poolMxBeans = ManagementFactory.getMemoryPoolMXBeans();
        if (poolMxBeans != null) {
            for (MemoryPoolMXBean bean : poolMxBeans) {
                if (bean.isValid()) {
                    String name = bean.getName();
                    MemoryType type = bean.getType();
                    MemoryUsage usage = bean.getUsage();
                    printMemoryUsage(out, name, type, usage);
                }
            }
        }
View Full Code Here


     * @return if <code>data</code> can be used to obtain an instance of
     *         <code>MemoryType</code> then a <code>MemoryType</code>,
     *         otherwise <code>null</code>.
     */
    private static MemoryType convertStringToMemoryType(String data) {
        MemoryType result = null;
        try {
            result = MemoryType.valueOf(data);
        } catch (IllegalArgumentException e) {
            if (ManagementUtils.VERBOSE_MODE) {
                e.printStackTrace(System.err);
View Full Code Here

     * Test method for 'java.lang.management.MemoryPoolMXBean.getType()'
     */
    public void testGetType() {
        MemoryType[] allTypes = MemoryType.values();
        for (MemoryPoolMXBean mb : allBeans) {
            MemoryType type = mb.getType();
            assertNotNull(type);
            boolean isOfKnownType = false;
            for (MemoryType knownType : allTypes) {
                if (type.equals(knownType)) {
                    isOfKnownType = true;
                    break;
                }
            }
            assertTrue(isOfKnownType);
View Full Code Here

     * @return if <code>data</code> can be used to obtain an instance of
     *         <code>MemoryType</code> then a <code>MemoryType</code>,
     *         otherwise <code>null</code>.
     */
    private static MemoryType convertStringToMemoryType(String data) {
        MemoryType result = null;
        try {
            result = MemoryType.valueOf(data);
        } catch (IllegalArgumentException e) {
            if (ManagementUtils.VERBOSE_MODE) {
                e.printStackTrace(System.err);
View Full Code Here

     * Test method for 'java.lang.management.MemoryPoolMXBean.getType()'
     */
    public void testGetType() {
        MemoryType[] allTypes = MemoryType.values();
        for (MemoryPoolMXBean mb : allBeans) {
            MemoryType type = mb.getType();
            assertNotNull(type);
            boolean isOfKnownType = false;
            for (MemoryType knownType : allTypes) {
                if (type.equals(knownType)) {
                    isOfKnownType = true;
                    break;
                }
            }
            assertTrue(isOfKnownType);
View Full Code Here

     * @return if <code>data</code> can be used to obtain an instance of
     *         <code>MemoryType</code> then a <code>MemoryType</code>,
     *         otherwise <code>null</code>.
     */
    private static MemoryType convertStringToMemoryType(String data) {
        MemoryType result = null;
        try {
            result = MemoryType.valueOf(data);
        } catch (IllegalArgumentException e) {
            if (ManagementUtils.VERBOSE_MODE) {
                e.printStackTrace(System.err);
View Full Code Here

     * @return if <code>data</code> can be used to obtain an instance of
     *         <code>MemoryType</code> then a <code>MemoryType</code>,
     *         otherwise <code>null</code>.
     */
    private static MemoryType convertStringToMemoryType(String data) {
        MemoryType result = null;
        try {
            result = MemoryType.valueOf(data);
        } catch (IllegalArgumentException e) {
            if (ManagementUtils.VERBOSE_MODE) {
                e.printStackTrace(System.err);
View Full Code Here

    if (not.getType().equals(MemoryNotificationInfo.MEMORY_THRESHOLD_EXCEEDED)) {
      CompositeDataSupport data=(CompositeDataSupport) not.getUserData();
     
     
      String poolName = (String) data.get("poolName");
      MemoryType type = types.get(poolName);
      if(type==MemoryType.HEAP){
        // clear heap
        aprint.e("Clear heap!");
      }
      else if(type==MemoryType.NON_HEAP) {
View Full Code Here

    },0,"memory");
   
    int row=0;
    MemoryPoolMXBean bean;
    MemoryUsage usage;
    MemoryType _type;
    while(it.hasNext()){
      bean = it.next();
      usage = bean.getUsage();
      _type = bean.getType();
      if(type==MEMORY_TYPE_HEAP && _type!=MemoryType.HEAP)continue;
      if(type==MEMORY_TYPE_NON_HEAP && _type!=MemoryType.NON_HEAP)continue;
       
      row++;
      qry.addRow();
      qry.setAtEL(KeyConstants._name, row, bean.getName());
      qry.setAtEL(KeyConstants._type, row, _type.name());
      qry.setAtEL(KeyConstants._max, row, Caster.toDouble(usage.getMax()));
      qry.setAtEL(KeyConstants._used, row, Caster.toDouble(usage.getUsed()));
      qry.setAtEL(KeyConstants._init, row, Caster.toDouble(usage.getInit()));
     
    }
View Full Code Here

    java.util.List<MemoryPoolMXBean> manager = ManagementFactory.getMemoryPoolMXBeans();
    Iterator<MemoryPoolMXBean> it = manager.iterator();
   
    MemoryPoolMXBean bean;
    MemoryUsage usage;
    MemoryType _type;
    long used=0,max=0,init=0;
    while(it.hasNext()){
      bean = it.next();
      usage = bean.getUsage();
      _type = bean.getType();
View Full Code Here

TOP

Related Classes of java.lang.management.MemoryType

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.