RFR: JDK-8301990: Separate Arguments::parse into two phases
Justin King
jcking at openjdk.org
Wed Feb 8 15:52:42 UTC 2023
On Tue, 7 Feb 2023 16:21:07 GMT, Justin King <jcking at openjdk.org> wrote:
> Separate out some logic from `Arguments::parse` into a separate preceding phase, preprocessing. See JDK-8301990 and JDK-8299196 for more details.
@dholmes-ora Part 1 of a multiple part effort to make NMT zero overhead when not in use. This patch does not change behavior.
The end idea (not reflected entirely in this change) is to split arguments parsing into two phases, preprocessing and parsing. Preprocessing does part of what parse does today. It goes through and collects all the arguments and expands the special flags along the way. It will not actually set flags. It also determines the winning values for `NativeMemoryTracking` and `MallocLimit` just as parsing would have. Preprocessing returns the list of collected arguments (with special flags removed) and the winning values. NMT will then immediately be initialized. The rest of initialization will proceed as normal, then parsing will occur. The end pseudo code (without error checking and correct names) will look something like:
Threads::create_vm() {
{
Arguments::Preprocessed preproc_args;
Arguments::preprocess(args, &preproc_args);
NMT::initialize(preproc_args.native_memory_tracking(), preproc_args.malloc_limit());
// Existing initialization code up until Arguments::parse ...
Arguments::parse(preproc_args);
}
// os::init_before_ergo() and the rest.
}
Preprocessing will use raw malloc/realloc/free.
-------------
PR: https://git.openjdk.org/jdk/pull/12458
More information about the hotspot-runtime-dev
mailing list