David, On Sun, Jan 18, 2026 at 11:04 PM David Holmes <[email protected]> wrote:
> You would lose potentially important information when reporting monitors > owned by a thread. I get that the class name may be useful for diagnostic purposes. However, the new Object() idiom has several thousand occurrences across the JDK, while new Lock() revealed only these two (plus a few in tests). These Lock classes seem like an easy win in the effort to trim the list of JDK class loading during startup/shutdown. Do you feel that the diagnostic value added by using named classes for these two instances outweighs the benefit of trimming class loading during startup? Also I think Valhalla is trying to dissuade/move-away-from using "new > Object()". Hmm.. The alternative solution cannot be to introduce custom Lock classes everywhere, right? Thanks, Eirik.
