src/share/vm/runtime/os.hpp

Print this page
rev 4499 : 8013120: NMT: Kitchensink crashes with assert(next_region == NULL || !next_region->is_committed_region()) failed: Sanity check
Summary: Fixed NMT to deal with releasing virtual memory region when there are still committed regions within it
Reviewed-by: acorn, coleenp


 238   static size_t page_size_for_region(size_t region_min_size,
 239                                      size_t region_max_size,
 240                                      uint min_pages);
 241 
 242   // Methods for tracing page sizes returned by the above method; enabled by
 243   // TracePageSizes.  The region_{min,max}_size parameters should be the values
 244   // passed to page_size_for_region() and page_size should be the result of that
 245   // call.  The (optional) base and size parameters should come from the
 246   // ReservedSpace base() and size() methods.
 247   static void trace_page_sizes(const char* str, const size_t* page_sizes,
 248                                int count) PRODUCT_RETURN;
 249   static void trace_page_sizes(const char* str, const size_t region_min_size,
 250                                const size_t region_max_size,
 251                                const size_t page_size,
 252                                const char* base = NULL,
 253                                const size_t size = 0) PRODUCT_RETURN;
 254 
 255   static int    vm_allocation_granularity();
 256   static char*  reserve_memory(size_t bytes, char* addr = 0,
 257                                size_t alignment_hint = 0);


 258   static char*  reserve_memory_aligned(size_t size, size_t alignment);
 259   static char*  attempt_reserve_memory_at(size_t bytes, char* addr);
 260   static void   split_reserved_memory(char *base, size_t size,
 261                                       size_t split, bool realloc);
 262   static bool   commit_memory(char* addr, size_t bytes, bool executable = false);
 263   static bool   commit_memory(char* addr, size_t size, size_t alignment_hint,
 264                               bool executable = false);
 265   static bool   uncommit_memory(char* addr, size_t bytes);
 266   static bool   release_memory(char* addr, size_t bytes);
 267 
 268   enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
 269   static bool   protect_memory(char* addr, size_t bytes, ProtType prot,
 270                                bool is_committed = true);
 271 
 272   static bool   guard_memory(char* addr, size_t bytes);
 273   static bool   unguard_memory(char* addr, size_t bytes);
 274   static bool   create_stack_guard_pages(char* addr, size_t bytes);
 275   static bool   pd_create_stack_guard_pages(char* addr, size_t bytes);
 276   static bool   remove_stack_guard_pages(char* addr, size_t bytes);
 277 




 238   static size_t page_size_for_region(size_t region_min_size,
 239                                      size_t region_max_size,
 240                                      uint min_pages);
 241 
 242   // Methods for tracing page sizes returned by the above method; enabled by
 243   // TracePageSizes.  The region_{min,max}_size parameters should be the values
 244   // passed to page_size_for_region() and page_size should be the result of that
 245   // call.  The (optional) base and size parameters should come from the
 246   // ReservedSpace base() and size() methods.
 247   static void trace_page_sizes(const char* str, const size_t* page_sizes,
 248                                int count) PRODUCT_RETURN;
 249   static void trace_page_sizes(const char* str, const size_t region_min_size,
 250                                const size_t region_max_size,
 251                                const size_t page_size,
 252                                const char* base = NULL,
 253                                const size_t size = 0) PRODUCT_RETURN;
 254 
 255   static int    vm_allocation_granularity();
 256   static char*  reserve_memory(size_t bytes, char* addr = 0,
 257                                size_t alignment_hint = 0);
 258   static char*  reserve_memory(size_t bytes, char* addr,
 259                                size_t alignment_hint, MEMFLAGS flags);
 260   static char*  reserve_memory_aligned(size_t size, size_t alignment);
 261   static char*  attempt_reserve_memory_at(size_t bytes, char* addr);
 262   static void   split_reserved_memory(char *base, size_t size,
 263                                       size_t split, bool realloc);
 264   static bool   commit_memory(char* addr, size_t bytes, bool executable = false);
 265   static bool   commit_memory(char* addr, size_t size, size_t alignment_hint,
 266                               bool executable = false);
 267   static bool   uncommit_memory(char* addr, size_t bytes);
 268   static bool   release_memory(char* addr, size_t bytes);
 269 
 270   enum ProtType { MEM_PROT_NONE, MEM_PROT_READ, MEM_PROT_RW, MEM_PROT_RWX };
 271   static bool   protect_memory(char* addr, size_t bytes, ProtType prot,
 272                                bool is_committed = true);
 273 
 274   static bool   guard_memory(char* addr, size_t bytes);
 275   static bool   unguard_memory(char* addr, size_t bytes);
 276   static bool   create_stack_guard_pages(char* addr, size_t bytes);
 277   static bool   pd_create_stack_guard_pages(char* addr, size_t bytes);
 278   static bool   remove_stack_guard_pages(char* addr, size_t bytes);
 279