Skip to content

Commit

Permalink
8333047: Remove arena-size-workaround in jvmtiUtils.cpp
Browse files Browse the repository at this point in the history
Reviewed-by: jsjolen, sspitsyn
  • Loading branch information
tstuefe committed May 31, 2024
1 parent 22ef827 commit ba323b5
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/hotspot/share/memory/arena.cpp
Original file line number Diff line number Diff line change
@@ -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.
*
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/memory/arena.hpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 2 additions & 3 deletions src/hotspot/share/prims/jvmtiUtil.cpp
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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;
}

1 comment on commit ba323b5

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.