KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > java > lang > management > MemoryType


1 /*
2  * @(#)MemoryType.java 1.7 04/04/18
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package java.lang.management;
9
10 /**
11  * Types of {@link MemoryPoolMXBean memory pools}.
12  *
13  * @author Mandy Chung
14  * @version 1.7, 04/18/04
15  * @since 1.5
16  */

17 public enum MemoryType {
18
19     /**
20      * Heap memory type.
21      * <p>
22      * The Java virtual machine has a <i>heap</i>
23      * that is the runtime data area from which
24      * memory for all class instances and arrays are allocated.
25      */

26     HEAP("Heap memory"),
27
28     /**
29      * Non-heap memory type.
30      * <p>
31      * The Java virtual machine manages memory other than the heap
32      * (referred as <i>non-heap memory</i>). The non-heap memory includes
33      * the <i>method area</i> and memory required for the internal
34      * processing or optimization for the Java virtual machine.
35      * It stores per-class structures such as a runtime
36      * constant pool, field and method data, and the code for
37      * methods and constructors.
38      */

39     NON_HEAP("Non-heap memory");
40
41     private final String JavaDoc description;
42
43     private MemoryType(String JavaDoc s) {
44         this.description = s;
45     }
46
47     /**
48      * Returns the string representation of this <tt>MemoryType</tt>.
49      * @return the string representation of this <tt>MemoryType</tt>.
50      */

51     public String JavaDoc toString() {
52         return description;
53     }
54
55     private static final long serialVersionUID = 6992337162326171013L;
56 }
57
Popular Tags