From: Amos Jeffries Date: Wed, 13 Jan 2010 01:53:11 +0000 (+1300) Subject: Account for mem_node overhead inside cache_mem X-Git-Tag: SQUID_3_1_0_16~44 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=61f08f1ba159b52703ac2e007ceb3fcaaace4127;p=thirdparty%2Fsquid.git Account for mem_node overhead inside cache_mem This makes squid include the overhead memory space when determining the number of data pages available in cache_mem memory space. Forming a much better limit on memory cache usage. This does NOT solve any issues created by sizeof(mem_node) being unaligned with the system malloc implementation page size. That still needs to be resolved. --- diff --git a/src/store.cc b/src/store.cc index 6db9e320f7..7738f80669 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1394,7 +1394,7 @@ storeConfigure(void) (float) Config.Swap.highWaterMark) / (float) 100); store_swap_low = (long) (((float) Store::Root().maxSize() * (float) Config.Swap.lowWaterMark) / (float) 100); - store_pages_max = Config.memMaxSize / SM_PAGE_SIZE; + store_pages_max = Config.memMaxSize / sizeof(mem_node); } int