RFR: 8258917: NativeMemoryTracking is handled by launcher inconsistenly [v2]

David Holmes dholmes at openjdk.java.net
Tue Jan 19 23:20:46 UTC 2021


On Tue, 19 Jan 2021 23:02:54 GMT, Alex Menkov <amenkov at openjdk.org> wrote:

>> The fix adds NMT handling for non-java launchers
>
> Alex Menkov has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Non-lava launchers should process all "-J" arguments

Hi Alex,

I think this is functionally correct now - though the comment you added is confusing to me (see below).

However I remain concerned that this requires processing the arg list twice for non-Java launchers. Is that a startup issue we should be concerned about?

Thanks,
David

src/java.base/share/native/libjli/java.c line 821:

> 819:          *   the -jar argument).
> 820:          * Non-java launchers:
> 821:          *   All "-J" arguments are translated to VM args (see TranslateApplicationArgs).

What do you mean by this? The -J args are not "translated" here but later in TranslateApplicationArgs.

For non-Java launchers AFAICS you have to process the entire argv array because you don't know where they may appear in general. So to me the comment should be:

* Other launchers (IsJavaArgs())
*   All arguments have to be scanned to see if it is a -J argument

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

PR: https://git.openjdk.java.net/jdk/pull/2106


More information about the core-libs-dev mailing list