From: Amos Jeffries Date: Sun, 31 Jan 2010 23:02:45 +0000 (+1300) Subject: Account for mem_node overhead inside cache_mem X-Git-Tag: SQUID_3_0_STABLE22~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07806c019f397dd1a7a7ddc4ca427a8cdb15c617;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 a6b6b8a018..982333806c 100644 --- a/src/store.cc +++ b/src/store.cc @@ -1429,7 +1429,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