equal
deleted
inserted
replaced
2545 ::madvise(addr, bytes, MADV_HUGEPAGE); |
2545 ::madvise(addr, bytes, MADV_HUGEPAGE); |
2546 } |
2546 } |
2547 } |
2547 } |
2548 |
2548 |
2549 void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { |
2549 void os::free_memory(char *addr, size_t bytes, size_t alignment_hint) { |
2550 commit_memory(addr, bytes, alignment_hint, false); |
2550 // This method works by doing an mmap over an existing mmaping and effectively discarding |
|
2551 // the existing pages. However it won't work for SHM-based large pages that cannot be |
|
2552 // uncommitted at all. We don't do anything in this case to avoid creating a segment with |
|
2553 // small pages on top of the SHM segment. This method always works for small pages, so we |
|
2554 // allow that in any case. |
|
2555 if (alignment_hint <= (size_t)os::vm_page_size() || !UseSHM) { |
|
2556 commit_memory(addr, bytes, alignment_hint, false); |
|
2557 } |
2551 } |
2558 } |
2552 |
2559 |
2553 void os::numa_make_global(char *addr, size_t bytes) { |
2560 void os::numa_make_global(char *addr, size_t bytes) { |
2554 Linux::numa_interleave_memory(addr, bytes); |
2561 Linux::numa_interleave_memory(addr, bytes); |
2555 } |
2562 } |