diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java b/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java index 629cc66d174b..921d6af5a417 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/Pool.java @@ -353,8 +353,10 @@ public Entry reserve() } } - protected Entry newEntry() + private Entry newEntry() { + // Do not allow more than 2 implementations of Entry, otherwise call sites in Pool + // referencing Entry methods will become mega-morphic and kill the performance. if (maxMultiplex >= 0 || maxUsage >= 0) return new MultiEntry(); return new MonoEntry();