1 /* |
1 /* |
2 * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2003, 2017, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. Oracle designates this |
7 * published by the Free Software Foundation. Oracle designates this |
34 * by methods that are used to obtain memory usage |
34 * by methods that are used to obtain memory usage |
35 * information about individual memory pool of the Java virtual machine or |
35 * information about individual memory pool of the Java virtual machine or |
36 * the heap or non-heap memory of the Java virtual machine as a whole. |
36 * the heap or non-heap memory of the Java virtual machine as a whole. |
37 * |
37 * |
38 * <p> A {@code MemoryUsage} object contains four values: |
38 * <p> A {@code MemoryUsage} object contains four values: |
39 * <table summary="Describes the MemoryUsage object content"> |
39 * <table> |
|
40 * <caption style="display:none">Describes the MemoryUsage object content</caption> |
40 * <tr> |
41 * <tr> |
41 * <td valign=top> {@code init} </td> |
42 * <td style="vertical-align:top"> {@code init} </td> |
42 * <td valign=top> represents the initial amount of memory (in bytes) that |
43 * <td style="vertical-align:top"> represents the initial amount of memory (in bytes) that |
43 * the Java virtual machine requests from the operating system |
44 * the Java virtual machine requests from the operating system |
44 * for memory management during startup. The Java virtual machine |
45 * for memory management during startup. The Java virtual machine |
45 * may request additional memory from the operating system and |
46 * may request additional memory from the operating system and |
46 * may also release memory to the system over time. |
47 * may also release memory to the system over time. |
47 * The value of {@code init} may be undefined. |
48 * The value of {@code init} may be undefined. |
48 * </td> |
49 * </td> |
49 * </tr> |
50 * </tr> |
50 * <tr> |
51 * <tr> |
51 * <td valign=top> {@code used} </td> |
52 * <td style="vertical-align:top"> {@code used} </td> |
52 * <td valign=top> represents the amount of memory currently used (in bytes). |
53 * <td style="vertical-align:top"> represents the amount of memory currently used (in bytes). |
53 * </td> |
54 * </td> |
54 * </tr> |
55 * </tr> |
55 * <tr> |
56 * <tr> |
56 * <td valign=top> {@code committed} </td> |
57 * <td style="vertical-align:top"> {@code committed} </td> |
57 * <td valign=top> represents the amount of memory (in bytes) that is |
58 * <td style="vertical-align:top"> represents the amount of memory (in bytes) that is |
58 * guaranteed to be available for use by the Java virtual machine. |
59 * guaranteed to be available for use by the Java virtual machine. |
59 * The amount of committed memory may change over time (increase |
60 * The amount of committed memory may change over time (increase |
60 * or decrease). The Java virtual machine may release memory to |
61 * or decrease). The Java virtual machine may release memory to |
61 * the system and {@code committed} could be less than {@code init}. |
62 * the system and {@code committed} could be less than {@code init}. |
62 * {@code committed} will always be greater than |
63 * {@code committed} will always be greater than |
63 * or equal to {@code used}. |
64 * or equal to {@code used}. |
64 * </td> |
65 * </td> |
65 * </tr> |
66 * </tr> |
66 * <tr> |
67 * <tr> |
67 * <td valign=top> {@code max} </td> |
68 * <td style="vertical-align:top"> {@code max} </td> |
68 * <td valign=top> represents the maximum amount of memory (in bytes) |
69 * <td style="vertical-align:top"> represents the maximum amount of memory (in bytes) |
69 * that can be used for memory management. Its value may be undefined. |
70 * that can be used for memory management. Its value may be undefined. |
70 * The maximum amount of memory may change over time if defined. |
71 * The maximum amount of memory may change over time if defined. |
71 * The amount of used and committed memory will always be less than |
72 * The amount of used and committed memory will always be less than |
72 * or equal to {@code max} if {@code max} is defined. |
73 * or equal to {@code max} if {@code max} is defined. |
73 * A memory allocation may fail if it attempts to increase the |
74 * A memory allocation may fail if it attempts to increase the |
250 * Returns a {@code MemoryUsage} object represented by the |
251 * Returns a {@code MemoryUsage} object represented by the |
251 * given {@code CompositeData}. The given {@code CompositeData} |
252 * given {@code CompositeData}. The given {@code CompositeData} |
252 * must contain the following attributes: |
253 * must contain the following attributes: |
253 * |
254 * |
254 * <blockquote> |
255 * <blockquote> |
255 * <table border summary="The attributes and the types the given CompositeData contains"> |
256 * <table border="1"> |
256 * <tr> |
257 * <caption style="display:none">The attributes and the types the given CompositeData contains</caption> |
257 * <th align=left>Attribute Name</th> |
258 * <tr> |
258 * <th align=left>Type</th> |
259 * <th style="text-align:left">Attribute Name</th> |
|
260 * <th style="text-align:left">Type</th> |
259 * </tr> |
261 * </tr> |
260 * <tr> |
262 * <tr> |
261 * <td>init</td> |
263 * <td>init</td> |
262 * <td>{@code java.lang.Long}</td> |
264 * <td>{@code java.lang.Long}</td> |
263 * </tr> |
265 * </tr> |