From 7cd076c796126692c308df5416b42b24a96609fb Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Thu, 8 Oct 2020 16:48:25 -0600 Subject: DRTVWR-510 remove all LL_SOLARIS conditionals --- indra/llcommon/llmemory.cpp | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) (limited to 'indra/llcommon/llmemory.cpp') diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index 1884d6f04f..7cf4bc0706 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -35,7 +35,7 @@ # include # include # include -#elif LL_LINUX || LL_SOLARIS +#elif LL_LINUX # include #endif @@ -309,35 +309,6 @@ U64 LLMemory::getCurrentRSS() return rss; } -#elif LL_SOLARIS -#include -#include -#include -#define _STRUCTURED_PROC 1 -#include - -U64 LLMemory::getCurrentRSS() -{ - char path [LL_MAX_PATH]; /* Flawfinder: ignore */ - - sprintf(path, "/proc/%d/psinfo", (int)getpid()); - int proc_fd = -1; - if((proc_fd = open(path, O_RDONLY)) == -1){ - LL_WARNS() << "LLmemory::getCurrentRSS() unable to open " << path << ". Returning 0 RSS!" << LL_ENDL; - return 0; - } - psinfo_t proc_psinfo; - if(read(proc_fd, &proc_psinfo, sizeof(psinfo_t)) != sizeof(psinfo_t)){ - LL_WARNS() << "LLmemory::getCurrentRSS() Unable to read from " << path << ". Returning 0 RSS!" << LL_ENDL; - close(proc_fd); - return 0; - } - - close(proc_fd); - - return((U64)proc_psinfo.pr_rssize * 1024); -} - #else U64 LLMemory::getCurrentRSS() -- cgit v1.2.3 From d12305496f73e0b55e8e1ec327a2567ca713da22 Mon Sep 17 00:00:00 2001 From: Dave Houlton Date: Mon, 19 Oct 2020 13:46:04 -0600 Subject: DRTVWR-510 clean up obsolete downstream-from-mDebugGPU code --- indra/llcommon/llmemory.cpp | 54 +-------------------------------------------- 1 file changed, 1 insertion(+), 53 deletions(-) (limited to 'indra/llcommon/llmemory.cpp') diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index 7cf4bc0706..ea84e4c1ea 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -55,7 +55,6 @@ static LLTrace::SampleStatHandle sVirtualMem("virtual_mem", "virtu U32Kilobytes LLMemory::sAllocatedMemInKB(0); U32Kilobytes LLMemory::sAllocatedPageSizeInKB(0); U32Kilobytes LLMemory::sMaxHeapSizeInKB(U32_MAX); -BOOL LLMemory::sEnableMemoryFailurePrevention = FALSE; void ll_assert_aligned_func(uintptr_t ptr,U32 alignment) { @@ -75,10 +74,9 @@ void ll_assert_aligned_func(uintptr_t ptr,U32 alignment) } //static -void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size, BOOL prevent_heap_failure) +void LLMemory::initMaxHeapSizeGB(F32Gigabytes max_heap_size) { sMaxHeapSizeInKB = U32Kilobytes::convert(max_heap_size); - sEnableMemoryFailurePrevention = prevent_heap_failure ; } //static @@ -158,56 +156,6 @@ void LLMemory::logMemoryInfo(BOOL update) LL_INFOS() << "Current max usable memory(KB): " << sMaxPhysicalMemInKB << LL_ENDL ; } -//return 0: everything is normal; -//return 1: the memory pool is low, but not in danger; -//return -1: the memory pool is in danger, is about to crash. -//static -bool LLMemory::isMemoryPoolLow() -{ - static const U32Megabytes LOW_MEMORY_POOL_THRESHOLD(64); - const static U32Megabytes MAX_SIZE_CHECKED_MEMORY_BLOCK(64); - static void* last_reserved_address = NULL ; - - if(!sEnableMemoryFailurePrevention) - { - return false ; //no memory failure prevention. - } - - if(sAvailPhysicalMemInKB < (LOW_MEMORY_POOL_THRESHOLD / 4)) //out of physical memory - { - return true ; - } - - if(sAllocatedPageSizeInKB + (LOW_MEMORY_POOL_THRESHOLD / 4) > sMaxHeapSizeInKB) //out of virtual address space. - { - return true ; - } - - bool is_low = (S32)(sAvailPhysicalMemInKB < LOW_MEMORY_POOL_THRESHOLD - || sAllocatedPageSizeInKB + LOW_MEMORY_POOL_THRESHOLD > sMaxHeapSizeInKB) ; - - //check the virtual address space fragmentation - if(!is_low) - { - if(!last_reserved_address) - { - last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ; - } - else - { - last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ; - if(!last_reserved_address) //failed, try once more - { - last_reserved_address = LLMemory::tryToAlloc(last_reserved_address, MAX_SIZE_CHECKED_MEMORY_BLOCK.value()) ; - } - } - - is_low = !last_reserved_address ; //allocation failed - } - - return is_low ; -} - //static U32Kilobytes LLMemory::getAvailableMemKB() { -- cgit v1.2.3