RFR: 8252921: NMT overwrite memory type for region assert when building dynamic archive
Calvin Cheung
ccheung at openjdk.java.net
Tue Sep 15 19:34:12 UTC 2020
On Tue, 15 Sep 2020 14:37:44 GMT, Zhengyu Gu <zgu at openjdk.org> wrote:
> Thread stack is currently unregistered with NMT in Thread's destructor. Apparently, only Java thread invokes destructor
> before thread exits. For NonJavaThread, e.g. ConcurrentGCThread, thread may exit while its "Thread" object continues
> alive, therefore, its thread stack is still "alive" from NMT perspective. Once thread exits, the virtual memory for the
> thread stack can be reserved again, that confused NMT. The solution is to move thread stack unregistration code to
> post_run() method.
Thanks for the fix. I've done some testing on the patch. It passed tier1 and also passed running the
appcds/dynamicArchive/methodHandles/MethodHandlesAsCollectorTest.java test 30 times on Windows and linux. One question
: why the JavaThread::post_run doesn't need to set the following?
set_stack_base(NULL);
set_stack_size(0);
-------------
Marked as reviewed by ccheung (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/185
More information about the hotspot-runtime-dev
mailing list