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

Java Usage Tracker does not write usage if VM is executed for short time

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Won't Fix
    • Affects Version/s: 8u251, 14.0.1
    • Fix Version/s: tbd
    • Component/s: core-svc
    • Labels:

      Description

      Java Usage Tracker does not work reliably if VM is executed for short time.
      For instance executions of simple HelloWorld app is not tracked

      public class HelloWorld {
         public static void main(String[] args) throws Exception {
                     System.out.println("Hello, World");
          }
      }


      Steps to reproduce
      $ export JAVA_HOME=/usr/java/jdk1.8.0_251-amd64/
      $ java -version
      java version "1.8.0_251"
      Java(TM) SE Runtime Environment (build 1.8.0_251-b08)
      Java HotSpot(TM) 64-Bit Server VM (build 25.251-b08, mixed mode)
      $ cat /etc/oracle/java/usagetracker.properties
      com.oracle.usagetracker.logToFile=/tmp/java.log
      $java HelloWorld
      Hello, World
      $ cat /tmp/java.log
      cat: /tmp/java.log: No such file or directory

      Expected result is, that usage is recorded to /tmp/java.log, but it is empty.
      Although simple "java -version" command should be also recorded, but it is not.

      If the execution is longer, usage tracking works:

      public class HelloWorld {
         public static void main(String[] args) throws Exception {
                     Thread.sleep(60);
                     System.out.println("Hello, World");
          }
      }


      The same behavior observed on Oracle JDK 1.8.0_251-b08 and 14.0.1

      It looks like file is not closed if the VM exits quickly.

        Attachments

          Activity

            People

            • Assignee:
              lcable Larry Cable
              Reporter:
              jbecicka Jan Becicka
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: