< prev index next >

src/hotspot/os/windows/os_windows.cpp

Print this page

2710 // scenario, I found through experiment it only uses large page if the entire
2711 // memory region is reserved and committed in a single VirtualAlloc() call.
2712 // This makes Windows large page support more or less like Solaris ISM, in
2713 // that the entire heap must be committed upfront. This probably will change
2714 // in the future, if so the code below needs to be revisited.
2715 
2716 #ifndef MEM_LARGE_PAGES
2717   #define MEM_LARGE_PAGES 0x20000000
2718 #endif
2719 
2720 static HANDLE    _hProcess;
2721 static HANDLE    _hToken;
2722 
2723 // Container for NUMA node list info
2724 class NUMANodeListHolder {
2725  private:
2726   int *_numa_used_node_list;  // allocated below
2727   int _numa_used_node_count;
2728 
2729   void free_node_list() {
2730     if (_numa_used_node_list != NULL) {
2731       FREE_C_HEAP_ARRAY(int, _numa_used_node_list);
2732     }
2733   }
2734 
2735  public:
2736   NUMANodeListHolder() {
2737     _numa_used_node_count = 0;
2738     _numa_used_node_list = NULL;
2739     // do rest of initialization in build routine (after function pointers are set up)
2740   }
2741 
2742   ~NUMANodeListHolder() {
2743     free_node_list();
2744   }
2745 
2746   bool build() {
2747     DWORD_PTR proc_aff_mask;
2748     DWORD_PTR sys_aff_mask;
2749     if (!GetProcessAffinityMask(GetCurrentProcess(), &proc_aff_mask, &sys_aff_mask)) return false;
2750     ULONG highest_node_number;
2751     if (!GetNumaHighestNodeNumber(&highest_node_number)) return false;
2752     free_node_list();

2710 // scenario, I found through experiment it only uses large page if the entire
2711 // memory region is reserved and committed in a single VirtualAlloc() call.
2712 // This makes Windows large page support more or less like Solaris ISM, in
2713 // that the entire heap must be committed upfront. This probably will change
2714 // in the future, if so the code below needs to be revisited.
2715 
2716 #ifndef MEM_LARGE_PAGES
2717   #define MEM_LARGE_PAGES 0x20000000
2718 #endif
2719 
2720 static HANDLE    _hProcess;
2721 static HANDLE    _hToken;
2722 
2723 // Container for NUMA node list info
2724 class NUMANodeListHolder {
2725  private:
2726   int *_numa_used_node_list;  // allocated below
2727   int _numa_used_node_count;
2728 
2729   void free_node_list() {
2730     FREE_C_HEAP_ARRAY(int, _numa_used_node_list);


2731   }
2732 
2733  public:
2734   NUMANodeListHolder() {
2735     _numa_used_node_count = 0;
2736     _numa_used_node_list = NULL;
2737     // do rest of initialization in build routine (after function pointers are set up)
2738   }
2739 
2740   ~NUMANodeListHolder() {
2741     free_node_list();
2742   }
2743 
2744   bool build() {
2745     DWORD_PTR proc_aff_mask;
2746     DWORD_PTR sys_aff_mask;
2747     if (!GetProcessAffinityMask(GetCurrentProcess(), &proc_aff_mask, &sys_aff_mask)) return false;
2748     ULONG highest_node_number;
2749     if (!GetNumaHighestNodeNumber(&highest_node_number)) return false;
2750     free_node_list();
< prev index next >