From 9724468011ab76c367a15dd693f8ca7e3a7575af Mon Sep 17 00:00:00 2001 From: rousskov <> Date: Wed, 23 Jan 2008 00:13:36 +0000 Subject: [PATCH] bug1933 fix: Fixed memory pools configuration reporting. We used to report too early, before Squid configuration was parsed. --- src/Mem.h | 3 ++- src/main.cc | 5 ++++- src/mem.cc | 13 ++++++++++--- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/Mem.h b/src/Mem.h index 22f7d44c7b..92653165c9 100644 --- a/src/Mem.h +++ b/src/Mem.h @@ -1,6 +1,6 @@ /* - * $Id: Mem.h,v 1.4 2006/05/29 00:15:01 robertc Exp $ + * $Id: Mem.h,v 1.5 2008/01/22 17:13:36 rousskov Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -47,6 +47,7 @@ class Mem public: static void Init(); + static void Report(); static void RegisterWithCacheManager(CacheManager & manager); static void Stats(StoreEntry *); static void CleanIdlePools(void *unused); diff --git a/src/main.cc b/src/main.cc index b4a53f36e5..183b0040c5 100644 --- a/src/main.cc +++ b/src/main.cc @@ -1,6 +1,6 @@ /* - * $Id: main.cc,v 1.454 2007/12/29 18:32:31 hno Exp $ + * $Id: main.cc,v 1.455 2008/01/22 17:13:36 rousskov Exp $ * * DEBUG: section 1 Startup and Main Loop * AUTHOR: Harvest Derived @@ -636,6 +636,7 @@ mainReconfigure(void) errorClean(); enter_suid(); /* root to read config file */ parseConfigFile(ConfigFile, manager); + Mem::Report(); setEffectiveUser(); _db_init(Config.Log.log, Config.debugOptions); ipcache_restart(); /* clear stuck entries */ @@ -1192,6 +1193,8 @@ main(int argc, char **argv) parse_err = parseConfigFile(ConfigFile, manager); + Mem::Report(); + if (opt_parse_cfg_only) return parse_err; diff --git a/src/mem.cc b/src/mem.cc index 8e253ec7da..8d4b005243 100644 --- a/src/mem.cc +++ b/src/mem.cc @@ -1,6 +1,6 @@ /* - * $Id: mem.cc,v 1.106 2007/11/15 16:47:35 wessels Exp $ + * $Id: mem.cc,v 1.107 2008/01/22 17:13:36 rousskov Exp $ * * DEBUG: section 13 High Level Memory Pool Management * AUTHOR: Harvest Derived @@ -382,8 +382,6 @@ Mem::Init(void) * debug messages here at level 0 or 1 will always be printed * on stderr. */ - debugs(13, 3, "Memory pools are '" << ((Config.onoff.mem_pools ? "on" : "off")) << "'; limit: "<< - std::setprecision(3) << toMB(MemPools::GetInstance().idleLimit()) << " MB"); /* set all pointers to null */ memset(MemPools, '\0', sizeof(MemPools)); @@ -430,6 +428,15 @@ Mem::Init(void) } } +void +Mem::Report() +{ + debugs(13, 3, "Memory pools are '" << + (Config.onoff.mem_pools ? "on" : "off") << "'; limit: " << + std::setprecision(3) << toMB(MemPools::GetInstance().idleLimit()) << + " MB"); +} + void Mem::RegisterWithCacheManager(CacheManager & manager) { -- 2.47.2