]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Account for mem_node overhead inside cache_mem
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 31 Jan 2010 23:02:45 +0000 (12:02 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 31 Jan 2010 23:02:45 +0000 (12:02 +1300)
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.

src/store.cc

index a6b6b8a0188e2f3100d90183714e5bf42efa7289..982333806c2fed8eaf31a25db0c7ce7e9fd5496f 100644 (file)
@@ -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