comparison src/os/solaris/vm/os_solaris.cpp @ 656:6bdd6923ba16

6541756: Reduce executable C-heap Summary: Add executable parameters to reserve_memory and commit_memory to reduce executable memory to only the Code Heap. Reviewed-by: xlu, kvn, acorn
author coleenp
date Wed, 25 Mar 2009 14:19:20 -0400
parents bd441136a5ce
children 956304450e80
comparison
equal deleted inserted replaced
655:60bfce711da4 656:6bdd6923ba16
2621 int os::vm_allocation_granularity() { 2621 int os::vm_allocation_granularity() {
2622 assert(page_size != -1, "must call os::init"); 2622 assert(page_size != -1, "must call os::init");
2623 return page_size; 2623 return page_size;
2624 } 2624 }
2625 2625
2626 bool os::commit_memory(char* addr, size_t bytes) { 2626 bool os::commit_memory(char* addr, size_t bytes, bool exec) {
2627 int prot = exec ? PROT_READ|PROT_WRITE|PROT_EXEC : PROT_READ|PROT_WRITE;
2627 size_t size = bytes; 2628 size_t size = bytes;
2628 return 2629 return
2629 NULL != Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, 2630 NULL != Solaris::mmap_chunk(addr, size, MAP_PRIVATE|MAP_FIXED, prot);
2630 PROT_READ | PROT_WRITE | PROT_EXEC); 2631 }
2631 } 2632
2632 2633 bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint,
2633 bool os::commit_memory(char* addr, size_t bytes, size_t alignment_hint) { 2634 bool exec) {
2634 if (commit_memory(addr, bytes)) { 2635 if (commit_memory(addr, bytes, exec)) {
2635 if (UseMPSS && alignment_hint > (size_t)vm_page_size()) { 2636 if (UseMPSS && alignment_hint > (size_t)vm_page_size()) {
2636 // If the large page size has been set and the VM 2637 // If the large page size has been set and the VM
2637 // is using large pages, use the large page size 2638 // is using large pages, use the large page size
2638 // if it is smaller than the alignment hint. This is 2639 // if it is smaller than the alignment hint. This is
2639 // a case where the VM wants to use a larger alignment size 2640 // a case where the VM wants to use a larger alignment size
3218 return false; 3219 return false;
3219 } 3220 }
3220 return true; 3221 return true;
3221 } 3222 }
3222 3223
3223 char* os::reserve_memory_special(size_t bytes, char* addr) { 3224 char* os::reserve_memory_special(size_t bytes, char* addr, bool exec) {
3225 // "exec" is passed in but not used. Creating the shared image for
3226 // the code cache doesn't have an SHM_X executable permission to check.
3224 assert(UseLargePages && UseISM, "only for ISM large pages"); 3227 assert(UseLargePages && UseISM, "only for ISM large pages");
3225 3228
3226 size_t size = bytes; 3229 size_t size = bytes;
3227 char* retAddr = NULL; 3230 char* retAddr = NULL;
3228 int shmid; 3231 int shmid;