Integrated: 8277981: String Deduplication table is never cleaned up due to bad dead_factor_for_cleanup

Aleksey Shipilev shade at openjdk.java.net
Wed Dec 1 12:10:30 UTC 2021


On Tue, 30 Nov 2021 12:30:11 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

> See the reproducer and analysis in the bug. 
> 
> The root cause for this problem is that `percent_of` returns `0..100` (percent) value of `nominator / denominator`. Which means if we feed `percent` and `100` there, this is an identity operation, returning the same value. And we wanted the conversion from percent to factor instead.
> 
> The default value for `StringDeduplicationCleanupDeadPercent` is `5`, which means (assuming `dead_count <= entry_count`) this erroneous conversion makes this condition always `false`:
> 
> 
> bool StringDedup::Config::should_cleanup_table(size_t entry_count, size_t dead_count) {
>   return (dead_count > _minimum_dead_for_cleanup) &&
>          (dead_count > (entry_count * _dead_factor_for_cleanup));
> }
> 
> 
> Additional testing:
>  - [x] Reproducer stress test does not leak anymore
>  - [x] Linux x86_64 fastdebug tier1, `-XX:+UseStringDeduplication`
>  - [x] Linux x86_64 fastdebug tier2, `-XX:+UseStringDeduplication`
>  - [x] Linux x86_64 fastdebug tier3, `-XX:+UseStringDeduplication`

This pull request has now been integrated.

Changeset: 8d7958e4
Author:    Aleksey Shipilev <shade at openjdk.org>
URL:       https://git.openjdk.java.net/jdk/commit/8d7958e46969fd59df7bc6dd1cbe31ae63686b05
Stats:     1 line in 1 file changed: 0 ins; 0 del; 1 mod

8277981: String Deduplication table is never cleaned up due to bad dead_factor_for_cleanup

Reviewed-by: zgu, kbarrett, tschatzl

-------------

PR: https://git.openjdk.java.net/jdk/pull/6613



More information about the hotspot-gc-dev mailing list