01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one or more
03: * contributor license agreements. See the NOTICE file distributed with
04: * this work for additional information regarding copyright ownership.
05: * The ASF licenses this file to You under the Apache License, Version 2.0
06: * (the "License"); you may not use this file except in compliance with
07: * the License. You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17:
18: package java.lang.management;
19:
20: /**
21: * <p>
22: * <code>MemoryMXBean</code> is an interface used by the management
23: * system to access memory-related properties.
24: * </p>
25: * <p>
26: * <code>ObjectName</code>: java.lang:type=Memory
27: * </p>
28: *
29: * @since 1.5
30: */
31: public interface MemoryMXBean {
32:
33: /**
34: * <p>
35: * Invokes the JVM's garbage collector; equivalent to {@link System#gc()}.
36: * </p>
37: */
38: void gc();
39:
40: /**
41: * <p>
42: * The current memory usage for the heap; memory used for object allocation.
43: * </p>
44: *
45: * @return A {@link MemoryUsage} instance representing heap memory.
46: */
47: MemoryUsage getHeapMemoryUsage();
48:
49: /**
50: * <p>
51: * The current memory usage outside of the heap.
52: * </p>
53: *
54: * @return A {@link MemoryUsage} instance representing non-heap memory.
55: */
56: MemoryUsage getNonHeapMemoryUsage();
57:
58: /**
59: * <p>
60: * The approximate number of objects that are about to be finalized.
61: * </p>
62: *
63: * @return The number of objects about to be finalized.
64: */
65: int getObjectPendingFinalizationCount();
66:
67: /**
68: * <p>
69: * Indicates whether or not the verbose output is enabled for the memory
70: * system.
71: * </p>
72: *
73: * @return <code>true</code> is verbose output is enabled, otherwise
74: * <code>false</code>.
75: */
76: boolean isVerbose();
77:
78: /**
79: * <p>
80: * Enables or disables the verbose output of the memory system.
81: * </p>
82: *
83: * @param value <code>true</code> to enable, <code>false</code> to
84: * disable.
85: * @throws SecurityException if caller doesn't have
86: * <code>ManagementPermission("control")</code>.
87: */
88: void setVerbose(boolean value);
89: }
|