Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8260675

Improve NativeMemoryTracking handling

    XMLWordPrintable

    Details

    • Type: Enhancement
    • Status: New
    • Priority: P4
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: tools
    • Labels:
      None

      Description

      Currently launcher handle NativeMemoryTracking in a separate function SetJvmEnvironment:

      CreateExecutionEnvironment();
      SetJvmEnvironment();
      LoadJavaVM();
      if (IsJavaArgs()) {
          TranslateApplicationArgs(jargc, jargv, &argc, &argv);
      }
      ParseArguments();
      JVMInit();

      This SetJvmEnvironment function scans argument and sets env.variable if NativeMemoryTracking argument is found.
      ParseArguments also goes through all arguments, so NativeMemoryTracking handling can be performed there, i.e. extra cycle in SetJvmEnvironment can be dropped.
      SetJvmEnvironment logic must be executed before VM loading, so the code needs to be reordered:

      CreateExecutionEnvironment();
      if (IsJavaArgs()) {
          TranslateApplicationArgs(jargc, jargv, &argc, &argv);
      }
      ParseArguments(); <- SetJvmEnvironment logic moved there
      LoadJavaVM();
      JVMInit();

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            amenkov Alex Menkov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated: