RFR: 8284632: runtime/Thread/StopAtExit.java possibly leaking memory again
Patricio Chilano Mateo
pchilanomate at openjdk.java.net
Wed Apr 27 21:51:43 UTC 2022
On Wed, 27 Apr 2022 21:37:16 GMT, Daniel D. Daugherty <dcubed at openjdk.org> wrote:
>> @pchilano - Thanks for reviewing! I'll have to mull on your feedback and
>> then, of course, there will a long stress test cycle needed to verify.
>
> It appears that adding an `is_exiting()` check to `JavaThread::install_async_exception()`
> is insufficient. I restored my debug counter code and disabled the two leak fixes in this
> PR and retested:
>
>
> vm_exit: dcubed_async_global_alloc_cnt=936344
> vm_exit: dcubed_drop_installer_thread_terminated_cnt=113472
> vm_exit: dcubed_drop_is_exiting_cnt=13
> vm_exit: dcubed_async_blocked_cnt=67577
> dcubed_async_global_release_cnt=755282
>
>
> dcubed_async_global_alloc_cnt=936344 - dcubed_async_global_release_cnt=755282
> 181062 // The number of exceptions leaked.
>
> 181062 - dcubed_drop_is_exiting_cnt=13
> 181049 // The number of leaked exceptions that made it past the is_exiting() check.
>
> 181049 - dcubed_drop_installer_thread_terminated_cnt=113472
> 67577 // The number of exceptions that made it past the is_exiting() check and
> // the is_terminated() check in HandshakeOperation::do_handshake().
>
> 67577 - dcubed_async_blocked_cnt=67577
> 0 // The number of exception that made it past the cleanup in JavaThread::exit
The clean_async_exception_operation() call in exit() shouldn't be removed, only this is_async_installer() part. Adding the is_exiting() check will take care of preventing any new async exceptions after the clean_async_exception_operation() call.
-------------
PR: https://git.openjdk.java.net/jdk/pull/8388
More information about the hotspot-runtime-dev
mailing list