< prev index next >

src/share/vm/runtime/os.hpp

Print this page
rev 7180 : 8067469: G1 ignores AlwaysPreTouch
Summary: Factor out pretouch code of the various virtual space management classes and use them everywhere including in G1.
Reviewed-by: stefank, ehelin, dholmes
rev 7181 : 8049864: TestParallelHeapSizeFlags fails with unexpected heap size
Reviewed-by: sjohanss, jmasa


 248   // Binds the current process to a processor.
 249   //    Returns true if it worked, false if it didn't.
 250   static bool bind_to_processor(uint processor_id);
 251 
 252   // Give a name to the current thread.
 253   static void set_native_thread_name(const char *name);
 254 
 255   // Interface for stack banging (predetect possible stack overflow for
 256   // exception processing)  There are guard pages, and above that shadow
 257   // pages for stack overflow checking.
 258   static bool uses_stack_guard_pages();
 259   static bool allocate_stack_guard_pages();
 260   static void bang_stack_shadow_pages();
 261   static bool stack_shadow_pages_available(Thread *thread, methodHandle method);
 262 
 263   // OS interface to Virtual Memory
 264 
 265   // Return the default page size.
 266   static int    vm_page_size();
 267 
 268   // Return the page size to use for a region of memory.  The min_pages argument
 269   // is a hint intended to limit fragmentation; it says the returned page size
 270   // should be <= region_max_size / min_pages.  Because min_pages is a hint,
 271   // this routine may return a size larger than region_max_size / min_pages.
 272   //
 273   // The current implementation ignores min_pages if a larger page size is an
 274   // exact multiple of both region_min_size and region_max_size.  This allows
 275   // larger pages to be used when doing so would not cause fragmentation; in
 276   // particular, a single page can be used when region_min_size ==
 277   // region_max_size == a supported page size.
 278   static size_t page_size_for_region(size_t region_min_size,
 279                                      size_t region_max_size,
 280                                      uint min_pages);
 281   // Return the largest page size that can be used
 282   static size_t max_page_size() {
 283     // The _page_sizes array is sorted in descending order.
 284     return _page_sizes[0];
 285   }
 286 
 287   // Methods for tracing page sizes returned by the above method; enabled by
 288   // TracePageSizes.  The region_{min,max}_size parameters should be the values
 289   // passed to page_size_for_region() and page_size should be the result of that
 290   // call.  The (optional) base and size parameters should come from the
 291   // ReservedSpace base() and size() methods.
 292   static void trace_page_sizes(const char* str, const size_t* page_sizes,
 293                                int count) PRODUCT_RETURN;
 294   static void trace_page_sizes(const char* str, const size_t region_min_size,
 295                                const size_t region_max_size,
 296                                const size_t page_size,
 297                                const char* base = NULL,
 298                                const size_t size = 0) PRODUCT_RETURN;
 299 
 300   static int    vm_allocation_granularity();




 248   // Binds the current process to a processor.
 249   //    Returns true if it worked, false if it didn't.
 250   static bool bind_to_processor(uint processor_id);
 251 
 252   // Give a name to the current thread.
 253   static void set_native_thread_name(const char *name);
 254 
 255   // Interface for stack banging (predetect possible stack overflow for
 256   // exception processing)  There are guard pages, and above that shadow
 257   // pages for stack overflow checking.
 258   static bool uses_stack_guard_pages();
 259   static bool allocate_stack_guard_pages();
 260   static void bang_stack_shadow_pages();
 261   static bool stack_shadow_pages_available(Thread *thread, methodHandle method);
 262 
 263   // OS interface to Virtual Memory
 264 
 265   // Return the default page size.
 266   static int    vm_page_size();
 267 
 268   // Returns the page size to use for a region of memory.
 269   // region_size / min_pages will always be greater than or equal to the
 270   // returned value.
 271   static size_t page_size_for_region(size_t region_size, size_t min_pages);
 272 








 273   // Return the largest page size that can be used
 274   static size_t max_page_size() {
 275     // The _page_sizes array is sorted in descending order.
 276     return _page_sizes[0];
 277   }
 278 
 279   // Methods for tracing page sizes returned by the above method; enabled by
 280   // TracePageSizes.  The region_{min,max}_size parameters should be the values
 281   // passed to page_size_for_region() and page_size should be the result of that
 282   // call.  The (optional) base and size parameters should come from the
 283   // ReservedSpace base() and size() methods.
 284   static void trace_page_sizes(const char* str, const size_t* page_sizes,
 285                                int count) PRODUCT_RETURN;
 286   static void trace_page_sizes(const char* str, const size_t region_min_size,
 287                                const size_t region_max_size,
 288                                const size_t page_size,
 289                                const char* base = NULL,
 290                                const size_t size = 0) PRODUCT_RETURN;
 291 
 292   static int    vm_allocation_granularity();


< prev index next >