Skip to content

Commit

Permalink
8267839: trivial mem leak in numa
Browse files Browse the repository at this point in the history
Co-authored-by: Shoubing Ma <mashoubing1@huawei.com>
Reviewed-by: tschatzl, sjohanss
  • Loading branch information
Hamlin Li and mashoubing committed Jun 7, 2021
1 parent 52d88ee commit 95ddf7d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/hotspot/os/linux/os_linux.hpp
Expand Up @@ -385,19 +385,17 @@ class Linux {
// Returns true if bound to a single numa node, otherwise returns false.
static bool is_bound_to_single_node() {
int nodes = 0;
struct bitmask* bmp = NULL;
unsigned int node = 0;
unsigned int highest_node_number = 0;

if (_numa_get_membind != NULL && _numa_max_node != NULL && _numa_bitmask_isbitset != NULL) {
bmp = _numa_get_membind();
if (_numa_membind_bitmask != NULL && _numa_max_node != NULL && _numa_bitmask_isbitset != NULL) {
highest_node_number = _numa_max_node();
} else {
return false;
}

for (node = 0; node <= highest_node_number; node++) {
if (_numa_bitmask_isbitset(bmp, node)) {
if (_numa_bitmask_isbitset(_numa_membind_bitmask, node)) {
nodes++;
}
}
Expand Down

1 comment on commit 95ddf7d

@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.