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. package java.lang.management;
  8. /**
  9. * Types of {@link MemoryPoolMXBean memory pools}.
  10. *
  11. * @author Mandy Chung
  12. * @version 1.7, 04/18/04
  13. * @since 1.5
  14. */
  15. public enum MemoryType {
  16. /**
  17. * Heap memory type.
  18. * <p>
  19. * The Java virtual machine has a <i>heap</i>
  20. * that is the runtime data area from which
  21. * memory for all class instances and arrays are allocated.
  22. */
  23. HEAP("Heap memory"),
  24. /**
  25. * Non-heap memory type.
  26. * <p>
  27. * The Java virtual machine manages memory other than the heap
  28. * (referred as <i>non-heap memory</i>). The non-heap memory includes
  29. * the <i>method area</i> and memory required for the internal
  30. * processing or optimization for the Java virtual machine.
  31. * It stores per-class structures such as a runtime
  32. * constant pool, field and method data, and the code for
  33. * methods and constructors.
  34. */
  35. NON_HEAP("Non-heap memory");
  36. private final String description;
  37. private MemoryType(String s) {
  38. this.description = s;
  39. }
  40. /**
  41. * Returns the string representation of this <tt>MemoryType</tt>.
  42. * @return the string representation of this <tt>MemoryType</tt>.
  43. */
  44. public String toString() {
  45. return description;
  46. }
  47. private static final long serialVersionUID = 6992337162326171013L;
  48. }