src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.serviceprovider/src/org/graalvm/compiler/serviceprovider/GraalServices.java
changeset 51436 091c0d22e735
parent 50858 2d3e99a72541
child 52220 9c260a6b6471
equal deleted inserted replaced
51435:72c82bd05971 51436:091c0d22e735
   204         }
   204         }
   205         return globalTimeStamp.get();
   205         return globalTimeStamp.get();
   206     }
   206     }
   207 
   207 
   208     /**
   208     /**
   209      * Access to thread specific information made available via Java Management Extensions (JMX).
       
   210      * Using this abstraction enables avoiding a dependency to the {@code java.management} and
       
   211      * {@code jdk.management} modules on JDK 9 and later.
       
   212      */
       
   213     public abstract static class JMXService {
       
   214         protected abstract long getThreadAllocatedBytes(long id);
       
   215 
       
   216         protected abstract long getCurrentThreadCpuTime();
       
   217 
       
   218         protected abstract boolean isThreadAllocatedMemorySupported();
       
   219 
       
   220         protected abstract boolean isCurrentThreadCpuTimeSupported();
       
   221 
       
   222         protected abstract List<String> getInputArguments();
       
   223 
       
   224         // Placing this static field in JMXService (instead of GraalServices)
       
   225         // allows for lazy initialization.
       
   226         static final JMXService instance = loadSingle(JMXService.class, false);
       
   227     }
       
   228 
       
   229     /**
       
   230      * Returns an approximation of the total amount of memory, in bytes, allocated in heap memory
   209      * Returns an approximation of the total amount of memory, in bytes, allocated in heap memory
   231      * for the thread of the specified ID. The returned value is an approximation because some Java
   210      * for the thread of the specified ID. The returned value is an approximation because some Java
   232      * virtual machine implementations may use object allocation mechanisms that result in a delay
   211      * virtual machine implementations may use object allocation mechanisms that result in a delay
   233      * between the time an object is allocated and the time its size is recorded.
   212      * between the time an object is allocated and the time its size is recorded.
   234      * <p>
   213      * <p>