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

Print this page




 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
 184     // aligned. The "-XX:+PageAlignDirectMemory" option can be used to force




 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     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         return booted;
 167     }
 168 
 169     // Waits until VM completes initialization
 170     //
 171     // This method is invoked by the Finalizer thread
 172     public static boolean awaitBooted() throws InterruptedException {
 173         synchronized (lock) {
 174             while (!booted) {
 175                 lock.wait();
 176             }
 177         }
 178         return booted;
 179     }
 180 
 181     // A user-settable upper limit on the maximum amount of allocatable direct
 182     // buffer memory.  This value may be changed during VM initialization if
 183     // "java" is launched with "-XX:MaxDirectMemorySize=<size>".
 184     //
 185     // The initial value of this field is arbitrary; during JRE initialization
 186     // it will be reset to the value specified on the command line, if any,
 187     // otherwise to Runtime.getRuntime().maxMemory().
 188     //
 189     private static long directMemory = 64 * 1024 * 1024;
 190 
 191     // Returns the maximum amount of allocatable direct buffer memory.
 192     // The directMemory variable is initialized during system initialization
 193     // in the saveAndRemoveProperties method.
 194     //
 195     public static long maxDirectMemory() {
 196         return directMemory;
 197     }
 198 
 199     // User-controllable flag that determines if direct buffers should be page
 200     // aligned. The "-XX:+PageAlignDirectMemory" option can be used to force