From ba323b515d8821895356507bdb1e94df0776dd5a Mon Sep 17 00:00:00 2001 From: Thomas Stuefe Date: Fri, 31 May 2024 06:50:29 +0000 Subject: [PATCH] 8333047: Remove arena-size-workaround in jvmtiUtils.cpp Reviewed-by: jsjolen, sspitsyn --- src/hotspot/share/memory/arena.cpp | 3 +-- src/hotspot/share/memory/arena.hpp | 5 ++--- src/hotspot/share/prims/jvmtiUtil.cpp | 5 ++--- 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/src/hotspot/share/memory/arena.cpp b/src/hotspot/share/memory/arena.cpp index 44f1648921f6f..6faffe0d20b9c 100644 --- a/src/hotspot/share/memory/arena.cpp +++ b/src/hotspot/share/memory/arena.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * Copyright (c) 2019, 2023 SAP SE. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * @@ -43,7 +43,6 @@ STATIC_ASSERT(is_aligned((int)Chunk::tiny_size, ARENA_AMALLOC_ALIGNMENT)); STATIC_ASSERT(is_aligned((int)Chunk::init_size, ARENA_AMALLOC_ALIGNMENT)); STATIC_ASSERT(is_aligned((int)Chunk::medium_size, ARENA_AMALLOC_ALIGNMENT)); STATIC_ASSERT(is_aligned((int)Chunk::size, ARENA_AMALLOC_ALIGNMENT)); -STATIC_ASSERT(is_aligned((int)Chunk::non_pool_size, ARENA_AMALLOC_ALIGNMENT)); // MT-safe pool of same-sized chunks to reduce malloc/free thrashing // NB: not using Mutex because pools are used before Threads are initialized diff --git a/src/hotspot/share/memory/arena.hpp b/src/hotspot/share/memory/arena.hpp index d5af068ffe1df..4c95d656e2524 100644 --- a/src/hotspot/share/memory/arena.hpp +++ b/src/hotspot/share/memory/arena.hpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2017, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -66,8 +66,7 @@ class Chunk { tiny_size = 256 - slack, // Size of first chunk (tiny) init_size = 1*K - slack, // Size of first chunk (normal aka small) medium_size= 10*K - slack, // Size of medium-sized chunk - size = 32*K - slack, // Default size of an Arena chunk (following the first) - non_pool_size = init_size + 32 // An initial size which is not one of above + size = 32*K - slack // Default size of an Arena chunk (following the first) }; static void chop(Chunk* chunk); // Chop this chunk diff --git a/src/hotspot/share/prims/jvmtiUtil.cpp b/src/hotspot/share/prims/jvmtiUtil.cpp index 7c348b415fe40..fcc3ae9b71352 100644 --- a/src/hotspot/share/prims/jvmtiUtil.cpp +++ b/src/hotspot/share/prims/jvmtiUtil.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2023, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -39,8 +39,7 @@ ResourceArea* JvmtiUtil::_single_threaded_resource_area = nullptr; ResourceArea* JvmtiUtil::single_threaded_resource_area() { if (_single_threaded_resource_area == nullptr) { // lazily create the single threaded resource area - // pick a size which is not a standard since the pools don't exist yet - _single_threaded_resource_area = new (mtInternal) ResourceArea(Chunk::non_pool_size); + _single_threaded_resource_area = new (mtInternal) ResourceArea(); } return _single_threaded_resource_area; }