JavaTM Platform
Standard Ed. 6

java.lang.management
클래스 MemoryNotificationInfo

java.lang.Object 
  상위를 확장 java.lang.management.MemoryNotificationInfo


public class MemoryNotificationInfo
extends Object

메모리 통지에 관한 정보입니다.

메모리 풀의 메모리 사용량이 임계치를 넘고 있는 것을 Java 가상 머신이 검출하면(자),MemoryMXBean 에 의해 메모리 통지가 발행됩니다. 발행된 통지에는, 검출된 조건에 관한 이하의 메모리 통지 정보가 포함되어 있습니다.

MemoryNotificationInfo 객체를 나타내는 CompositeData 는,통지사용자 데이터 에 포함됩니다. from 메소드는,CompositeData 로부터 MemoryNotificationInfo 객체에의 변환을 실시합니다. 다음에 예를 나타냅니다.

      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);
          ....
      }  
 

MemoryMXBean 가 발행하는 통지의 형태는 이하대로입니다.

도입된 버젼:
1.5

필드의 개요
static String MEMORY_COLLECTION_THRESHOLD_EXCEEDED
          Java 가상 머신이 메모리 풀에서 사용하지 않는 객체의 리사이클에 최선을 다한 뒤, 메모리 풀의 메모리 사용량이컬렉션 사용량 임계치 이상인 것을 나타내는 통지의 형태입니다.
static String MEMORY_THRESHOLD_EXCEEDED
          메모리 풀의 메모리 사용량이사용량 임계치에 이르렀는지 넘은 것을 나타내는 통지의 형태.
 
생성자 의 개요
MemoryNotificationInfo (String  poolName, MemoryUsage  usage, long count)
          MemoryNotificationInfo 객체를 구축합니다.
 
메소드의 개요
static MemoryNotificationInfo from (CompositeData  cd)
          지정된 CompositeData 에 의해 나타내지는 MemoryNotificationInfo 객체를 돌려줍니다.
 long getCount ()
          통지가 구축되었을 때에, 메모리 사용량이 임계치를 넘은 회수를 돌려줍니다.
 String getPoolName ()
          이 통지를 트리거하는 메모리 풀의 이름을 돌려줍니다.
 MemoryUsage getUsage ()
          통지가 구축되었을 때의 메모리 풀의 메모리 사용량을 돌려줍니다.
 
클래스 java.lang. Object 로부터 상속된 메소드
clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait
 

필드의 상세

MEMORY_THRESHOLD_EXCEEDED

public static final String  MEMORY_THRESHOLD_EXCEEDED
메모리 풀의 메모리 사용량이사용량 임계치에 이르렀는지 넘은 것을 나타내는 통지의 형태. 이 통지는,MemoryMXBean 에 의해 발행됩니다. 이후, 사용량 임계치를 넘어도, 메모리 사용량이 사용량 임계치 미만에 돌아올 때까지, 통지는 발행되지 않습니다. 이 통지의 형태의 값은 java.management.memory.threshold.exceeded 입니다.

관련 항목:
정수 필드치

MEMORY_COLLECTION_THRESHOLD_EXCEEDED

public static final String  MEMORY_COLLECTION_THRESHOLD_EXCEEDED
Java 가상 머신이 메모리 풀에서 사용하지 않는 객체의 리사이클에 최선을 다한 뒤, 메모리 풀의 메모리 사용량이컬렉션 사용량 임계치 이상인 것을 나타내는 통지의 형태입니다. 이 통지는,MemoryMXBean 에 의해 발행됩니다. 이 통지의 형태의 값은,java.management.memory.collection.threshold.exceeded 입니다.

관련 항목:
정수 필드치
생성자 의 상세

MemoryNotificationInfo

public MemoryNotificationInfo(String  poolName,
                              MemoryUsage  usage,
                              long count)
MemoryNotificationInfo 객체를 구축합니다.

파라미터:
poolName - 이 통지를 트리거하는 메모리 풀의 이름
usage - 메모리 풀의 메모리 사용량
count - 임계치 초과 회수
메소드의 상세

getPoolName

public String  getPoolName()
이 통지를 트리거하는 메모리 풀의 이름을 돌려줍니다. 메모리 풀의 사용량은 임계치를 넘었습니다.

반환값:
이 통지를 트리거하는 메모리 풀의 이름

getUsage

public MemoryUsage  getUsage()
통지가 구축되었을 때의 메모리 풀의 메모리 사용량을 돌려줍니다.

반환값:
통지가 구축되었을 때의 메모리 풀의 메모리 사용량

getCount

public long getCount()
통지가 구축되었을 때에, 메모리 사용량이 임계치를 넘은 회수를 돌려줍니다. 사용량 임계치 통지의 경우, 이 카운트는,임계치 카운트 입니다. 컬렉션 임계치 통지의 경우, 이 카운트는,컬렉션 사용량 임계치 카운트 입니다.

반환값:
통지가 구축되었을 때에, 메모리 사용량이 임계치를 넘은 회수

from

public static MemoryNotificationInfo  from(CompositeData  cd)
지정된 CompositeData 에 의해 나타내지는 MemoryNotificationInfo 객체를 돌려줍니다. 지정된 CompositeData 는, 다음의 속성을 포함할 필요가 있습니다.
속성명
poolName java.lang.String
usage javax.management.openmbean.CompositeData
count java.lang.Long

파라미터:
cd - MemoryNotificationInfo 를 나타낸다 CompositeData
반환값:
cdnull 가 아닌 경우는, cd 에 의해 나타내지는 MemoryNotificationInfo 객체. 그렇지 않은 경우는 null
예외:
IllegalArgumentException - cdMemoryNotificationInfo 객체를 나타내지 않는 경우

JavaTM Platform
Standard Ed. 6

버그의 보고와 기능의 요청
한층 더 자세한 API 레퍼런스 및 개발자 문서에 대해서는,Java SE 개발자용 문서를 참조해 주세요. 개발자전용의 상세한 해설, 개념의 개요, 용어의 정의, 버그의 회피책, 및 코드 실례가 포함되어 있습니다.

Copyright 2006 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms . Documentation Redistribution Policy 도 참조해 주세요.