8180048: Interned string and symbol table leak memory during parallel unlinking

Make appending found dead BasicHashtableEntrys to the free list atomic.

Reviewed-by: ehelin, shade, coleenp
This commit is contained in:
Thomas Schatzl 2017-05-15 12:20:15 +02:00
parent 8e28d5772d
commit c775f6f58b
7 changed files with 97 additions and 29 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2017, 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
@ -154,8 +154,11 @@ private:
static volatile int _parallel_claimed_idx;
// Release any dead symbols
static void buckets_unlink(int start_idx, int end_idx, int* processed, int* removed);
typedef SymbolTable::BucketUnlinkContext BucketUnlinkContext;
// Release any dead symbols. Unlinked bucket entries are collected in the given
// context to be freed later.
// This allows multiple threads to work on the table at once.
static void buckets_unlink(int start_idx, int end_idx, BucketUnlinkContext* context);
public:
enum {
symbol_alloc_batch_size = 8,