]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Account for mem_node overhead inside cache_mem
authorAmos Jeffries <squid3@treenet.co.nz>
Wed, 13 Jan 2010 01:53:11 +0000 (14:53 +1300)
committerAmos Jeffries <squid3@treenet.co.nz>
Wed, 13 Jan 2010 01:53:11 +0000 (14:53 +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 6db9e320f7993cdfca94f4cc8a082c5068422a7a..7738f806692e2cc26cafa3ef7c17e031a4296ecc 100644 (file)
@@ -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