RFR: 8339114: DaCapo xalan performance with -XX:+UseObjectMonitorTable

Coleen Phillimore coleenp at openjdk.org
Tue Mar 25 18:40:10 UTC 2025


On Wed, 19 Mar 2025 11:31:38 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> I am not sure if I understand the problem. Why can't we do that? We successfully looked up the monitor from the OMCache, why can't we stick it in the BasicLock cache, to avoid having to look it up in the OMCache again? Whatever code would pull it out of the BasicLock and observe a deflating monitor might also pull it out of the OMCache and observe a deflating monitor, or is that not correct? I know that OMCache::get_monitor() filters deflating monitors, but that is not a guarantee that a monitor would not flip to deflating after that check? So ... the user of the monitor would always have to deal with deflation after it has pulled a monitor from any of the caches anyway?
>> 
>> If it is our contract that only successfully locked monitors go into the BasicLock cache, then we can't do that optimization, I think.
>
> Maybe this is okay.  My change that ran afoul of this test found the monitor in the first 32 entries of the ObjectSynchronizer::_in_use_list and filtered for deflating monitors also.  Then put the monitor it found in the OMCache. Since it didn't help performance, I backed this out of my change. It may be safer to put the monitor in the BasicLock field because it's cleared.  All this to say, I don't really know if this is right.

Looks like from GHA, this also fails the same test.  I think you should remove this optimization since I don't think it helps any.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24098#discussion_r2012732648


More information about the hotspot-runtime-dev mailing list