RFR: 8304292: Memory leak related to ClassLoader::update_class_path_entry_list

David Holmes dholmes at openjdk.org
Thu Aug 3 07:36:31 UTC 2023


On Thu, 3 Aug 2023 06:14:37 GMT, Calvin Cheung <ccheung at openjdk.org> wrote:

> Please review this small fix for `ClassPathEntry` leak when there's a duplicate entry in the app class path (`-cp`) and the `check_for_duplicate` argument is set to `true`, the `ClassLoader::add_to_app_classpath_entries` function should delete the entry before returning. This fix also corrects the call to `update_class_path_entry_list` from `setup_app_search_path`; the `check_for_duplicate` argument should be set to `true`. Two test cases are included to exercise the code path.
> 
> Passed tiers 1 - 4 testing.

This seems fine to me. Thanks.

src/hotspot/share/classfile/classLoader.cpp line 524:

> 522:   while (cp_stream.has_next()) {
> 523:     const char* path = cp_stream.get_next();
> 524:     update_class_path_entry_list(current, path, true, false, false);

Some comments on these boolean parameters would be useful.

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

Marked as reviewed by dholmes (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/15132#pullrequestreview-1560414853
PR Review Comment: https://git.openjdk.org/jdk/pull/15132#discussion_r1282769654


More information about the hotspot-runtime-dev mailing list