Skip to content

Commit

Permalink
change index size
Browse files Browse the repository at this point in the history
  • Loading branch information
keith-turner committed Sep 19, 2024
1 parent 849b93b commit 5cde6a9
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,12 @@ public static Cleanable deleteNM(Object obj, Logger log, AtomicLong nmPtr) {
});
}

// Chose 8 cleaners because each cleaner creates a thread, so do not want too many threads. This
// should reduce lock contention for scans by an 8th vs a single cleaner, so that is good
// reduction and 8 does not seem like too many threads to add.
private static final Cleaner[] NMI_CLEANERS = new Cleaner[8];
// Chose 7 cleaners because each cleaner creates a thread, so do not want too many threads. This
// should reduce lock contention for scans by a 7th vs a single cleaner, so that is good
// reduction and 7 does not seem like too many threads to add. This array is indexed using
// pointers addresses from native code, so there is a good chance those are memory aligned on
// a multiple of 4, 8, 16, etc. So if changing the array size avoid multiples of 2.
private static final Cleaner[] NMI_CLEANERS = new Cleaner[7];

static {
for (int i = 0; i < NMI_CLEANERS.length; i++) {
Expand Down

0 comments on commit 5cde6a9

Please sign in to comment.