src/share/vm/runtime/os.hpp

Print this page




 167   static bool vtime_enabled();
 168   static double elapsedVTime();
 169 
 170   // Return current local time in a string (YYYY-MM-DD HH:MM:SS).
 171   // It is MT safe, but not async-safe, as reading time zone
 172   // information may require a lock on some platforms.
 173   static char*      local_time_string(char *buf, size_t buflen);
 174   static struct tm* localtime_pd     (const time_t* clock, struct tm*  res);
 175   // Fill in buffer with current local time as an ISO-8601 string.
 176   // E.g., YYYY-MM-DDThh:mm:ss.mmm+zzzz.
 177   // Returns buffer, or NULL if it failed.
 178   static char* iso8601_time(char* buffer, size_t buffer_length);
 179 
 180   // Interface for detecting multiprocessor system
 181   static inline bool is_MP() {
 182     assert(_processor_count > 0, "invalid processor count");
 183     return _processor_count > 1;
 184   }
 185   static julong available_memory();
 186   static julong physical_memory();
 187   static julong allocatable_physical_memory(julong size);
 188   static bool is_server_class_machine();
 189 
 190   // number of CPUs
 191   static int processor_count() {
 192     return _processor_count;
 193   }
 194   static void set_processor_count(int count) { _processor_count = count; }
 195 
 196   // Returns the number of CPUs this process is currently allowed to run on.
 197   // Note that on some OSes this can change dynamically.
 198   static int active_processor_count();
 199 
 200   // Bind processes to processors.
 201   //     This is a two step procedure:
 202   //     first you generate a distribution of processes to processors,
 203   //     then you bind processes according to that distribution.
 204   // Compute a distribution for number of processes to processors.
 205   //    Stores the processor id's into the distribution array argument.
 206   //    Returns true if it worked, false if it didn't.
 207   static bool distribute_processes(uint length, uint* distribution);




 167   static bool vtime_enabled();
 168   static double elapsedVTime();
 169 
 170   // Return current local time in a string (YYYY-MM-DD HH:MM:SS).
 171   // It is MT safe, but not async-safe, as reading time zone
 172   // information may require a lock on some platforms.
 173   static char*      local_time_string(char *buf, size_t buflen);
 174   static struct tm* localtime_pd     (const time_t* clock, struct tm*  res);
 175   // Fill in buffer with current local time as an ISO-8601 string.
 176   // E.g., YYYY-MM-DDThh:mm:ss.mmm+zzzz.
 177   // Returns buffer, or NULL if it failed.
 178   static char* iso8601_time(char* buffer, size_t buffer_length);
 179 
 180   // Interface for detecting multiprocessor system
 181   static inline bool is_MP() {
 182     assert(_processor_count > 0, "invalid processor count");
 183     return _processor_count > 1;
 184   }
 185   static julong available_memory();
 186   static julong physical_memory();
 187   static bool has_allocatable_memory_limit(julong& limit);
 188   static bool is_server_class_machine();
 189 
 190   // number of CPUs
 191   static int processor_count() {
 192     return _processor_count;
 193   }
 194   static void set_processor_count(int count) { _processor_count = count; }
 195 
 196   // Returns the number of CPUs this process is currently allowed to run on.
 197   // Note that on some OSes this can change dynamically.
 198   static int active_processor_count();
 199 
 200   // Bind processes to processors.
 201   //     This is a two step procedure:
 202   //     first you generate a distribution of processes to processors,
 203   //     then you bind processes according to that distribution.
 204   // Compute a distribution for number of processes to processors.
 205   //    Stores the processor id's into the distribution array argument.
 206   //    Returns true if it worked, false if it didn't.
 207   static bool distribute_processes(uint length, uint* distribution);