src/share/classes/sun/misc/VM.java

Print this page




 130     // public native static void resumeJavaProfiler();
 131 
 132     /**
 133      * Suspend Java profiling.
 134      */
 135     // public native static void suspendJavaProfiler();
 136 
 137     /**
 138      * Initialize Java profiling.  Any accumulated profiling
 139      * information is discarded.
 140      */
 141     // public native static void resetJavaProfiler();
 142 
 143     /**
 144      * Write the current profiling contents to the file "java.prof".
 145      * If the file already exists, it will be overwritten.
 146      */
 147     // public native static void writeJavaProfilerReport();
 148 
 149 
 150     private static volatile boolean booted = false;

 151 
 152     // Invoked by by System.initializeSystemClass just before returning.
 153     // Subsystems that are invoked during initialization can check this
 154     // property in order to avoid doing things that should wait until the
 155     // application class loader has been set up.
 156     //
 157     public static void booted() {

 158         booted = true;


 159     }
 160 
 161     public static boolean isBooted() {

 162         return booted;
 163     }












 164 
 165     // A user-settable upper limit on the maximum amount of allocatable direct
 166     // buffer memory.  This value may be changed during VM initialization if
 167     // "java" is launched with "-XX:MaxDirectMemorySize=<size>".
 168     //
 169     // The initial value of this field is arbitrary; during JRE initialization
 170     // it will be reset to the value specified on the command line, if any,
 171     // otherwise to Runtime.getRuntime().maxMemory().
 172     //
 173     private static long directMemory = 64 * 1024 * 1024;
 174 
 175     // Returns the maximum amount of allocatable direct buffer memory.
 176     // The directMemory variable is initialized during system initialization
 177     // in the saveAndRemoveProperties method.
 178     //
 179     public static long maxDirectMemory() {
 180         return directMemory;
 181     }
 182 
 183     // User-controllable flag that determines if direct buffers should be page




 130     // public native static void resumeJavaProfiler();
 131 
 132     /**
 133      * Suspend Java profiling.
 134      */
 135     // public native static void suspendJavaProfiler();
 136 
 137     /**
 138      * Initialize Java profiling.  Any accumulated profiling
 139      * information is discarded.
 140      */
 141     // public native static void resetJavaProfiler();
 142 
 143     /**
 144      * Write the current profiling contents to the file "java.prof".
 145      * If the file already exists, it will be overwritten.
 146      */
 147     // public native static void writeJavaProfilerReport();
 148 
 149 
 150     private static boolean booted = false;
 151     private static final Object lock = new Object();
 152 
 153     // Invoked by by System.initializeSystemClass just before returning.
 154     // Subsystems that are invoked during initialization can check this
 155     // property in order to avoid doing things that should wait until the
 156     // application class loader has been set up.
 157     //
 158     public static void booted() {
 159         synchronized (lock) {
 160             booted = true;
 161             lock.notifyAll();
 162         }
 163     }
 164 
 165     public static boolean isBooted() {
 166         synchronized (lock) {
 167             return booted;
 168         }
 169     }
 170 
 171     // Waits until VM completes initialization
 172     //
 173     // This method is invoked by the Finalizer thread
 174     public static void awaitBooted() throws InterruptedException {
 175         synchronized (lock) {
 176             while (!booted) {
 177                 lock.wait();
 178             }
 179         }
 180     }
 181 
 182     // A user-settable upper limit on the maximum amount of allocatable direct
 183     // buffer memory.  This value may be changed during VM initialization if
 184     // "java" is launched with "-XX:MaxDirectMemorySize=<size>".
 185     //
 186     // The initial value of this field is arbitrary; during JRE initialization
 187     // it will be reset to the value specified on the command line, if any,
 188     // otherwise to Runtime.getRuntime().maxMemory().
 189     //
 190     private static long directMemory = 64 * 1024 * 1024;
 191 
 192     // Returns the maximum amount of allocatable direct buffer memory.
 193     // The directMemory variable is initialized during system initialization
 194     // in the saveAndRemoveProperties method.
 195     //
 196     public static long maxDirectMemory() {
 197         return directMemory;
 198     }
 199 
 200     // User-controllable flag that determines if direct buffers should be page