Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-4792

Tune the env log at the start of the process

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.9.1
    • 3.10
    • server

    Description

      At the start of the process, it will print the env info in the log.
      There are three logs for the memory metrics.

              // Get memory information.
              Runtime runtime = Runtime.getRuntime();
              int mb = 1024 * 1024;
              put(l, "os.memory.free", runtime.freeMemory() / mb + "MB");
              put(l, "os.memory.max", runtime.maxMemory() / mb + "MB");
              put(l, "os.memory.total", runtime.totalMemory() / mb + "MB");
      

      https://github.com/apache/zookeeper/blob/9e40464d98319b4553d93b12c6d7db4d240bbce9/zookeeper-server/src/main/java/org/apache/zookeeper/Environment.java#L88-L90

      It's misleading for the user, use jvm as the prefix will be better.

      Change to:

              // Get memory information.
              Runtime runtime = Runtime.getRuntime();
              int mb = 1024 * 1024;
              put(l, "jvm,.memory.free", runtime.freeMemory() / mb + "MB");
              put(l, "jvm.memory.max", runtime.maxMemory() / mb + "MB");
              put(l, "jvm.memory.total", runtime.totalMemory() / mb + "MB");
      

      Attachments

        Issue Links

          Activity

            People

              horizonzy Yan Zhao
              horizonzy Yan Zhao
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 50m
                  50m