4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 import jdk.test.lib.Asserts;
25 import jdk.test.lib.Utils;
26 import java.lang.management.MemoryPoolMXBean;
27 import javax.management.Notification;
28 import sun.hotspot.WhiteBox;
29 import sun.hotspot.code.BlobType;
30 import sun.hotspot.code.CodeBlob;
31
32 public final class CodeCacheUtils {
33
34 /**
35 * Returns the value to be used for code heap allocation
36 */
37 public static final int ALLOCATION_SIZE
38 = Integer.getInteger("codecache.allocation.size", 100);
39 public static final WhiteBox WB = WhiteBox.getWhiteBox();
40 public static final long SEGMENT_SIZE
41 = WhiteBox.getWhiteBox().getUintxVMFlag("CodeCacheSegmentSize");
42 public static final long MIN_BLOCK_LENGTH
43 = WhiteBox.getWhiteBox().getUintxVMFlag("CodeCacheMinBlockLength");
44 public static final long MIN_ALLOCATION = SEGMENT_SIZE * MIN_BLOCK_LENGTH;
45
46 private CodeCacheUtils() {
47 // To prevent from instantiation
48 }
49
50 public static final void hitUsageThreshold(MemoryPoolMXBean bean,
51 BlobType btype) {
|
4 *
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
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package compiler.codecache.jmx;
25
26 import jdk.test.lib.Asserts;
27 import jdk.test.lib.Utils;
28 import sun.hotspot.WhiteBox;
29 import sun.hotspot.code.BlobType;
30 import sun.hotspot.code.CodeBlob;
31
32 import javax.management.Notification;
33 import java.lang.management.MemoryPoolMXBean;
34
35 public final class CodeCacheUtils {
36
37 /**
38 * Returns the value to be used for code heap allocation
39 */
40 public static final int ALLOCATION_SIZE
41 = Integer.getInteger("codecache.allocation.size", 100);
42 public static final WhiteBox WB = WhiteBox.getWhiteBox();
43 public static final long SEGMENT_SIZE
44 = WhiteBox.getWhiteBox().getUintxVMFlag("CodeCacheSegmentSize");
45 public static final long MIN_BLOCK_LENGTH
46 = WhiteBox.getWhiteBox().getUintxVMFlag("CodeCacheMinBlockLength");
47 public static final long MIN_ALLOCATION = SEGMENT_SIZE * MIN_BLOCK_LENGTH;
48
49 private CodeCacheUtils() {
50 // To prevent from instantiation
51 }
52
53 public static final void hitUsageThreshold(MemoryPoolMXBean bean,
54 BlobType btype) {
|