Memory Management.
Classes | |
class | Allocator |
class | AllocatorProxy |
class | Meter |
class | PoolMeter |
class | PoolStats |
Functions | |
void | Init () |
void | Stats (StoreEntry *) |
void | CleanIdlePools (void *unused) |
void | Report (std::ostream &) |
void | PoolReport (const PoolStats *, const PoolMeter *, std::ostream &) |
void | ZeroSensitiveMemory (void *dst, const size_t len) |
size_t | GlobalStats (PoolStats &) |
Function Documentation
◆ CleanIdlePools()
void Mem::CleanIdlePools | ( | void * | unused | ) |
Definition at line 399 of file old_api.cc.
References MemPools::clean(), clean_interval, CleanIdlePools(), eventAdd(), and MemPools::GetInstance().
Referenced by CleanIdlePools(), and mainInitialize().
◆ GlobalStats()
Fills a Mem::PoolStats with statistical data about overall usage for all pools.
- Returns
- Number of pools that have at least one object in use. Ie. number of dirty pools.
Definition at line 15 of file Stats.cc.
References MemPools::flushMeters(), MemPools::GetInstance(), MemPools::pools, Ping::stats, and TheMeter.
Referenced by DumpInfo(), GetInfo(), memClean(), Report(), and snmp_prfSysFn().
◆ Init()
void Mem::Init | ( | void | ) |
Then initialize all pools.
- Starting with generic 2kB - 64kB buffr pools, then specific object types.
- It does not hurt much to have a lot of pools since sizeof(MemPool) is small; someday we will figure out what to do with all the entries here that are never used or used only once; perhaps we should simply use malloc() for those? @?@
Definition at line 425 of file old_api.cc.
References GetPool(), MEM_16K_BUF, MEM_2K_BUF, MEM_32K_BUF, MEM_4K_BUF, MEM_64K_BUF, MEM_8K_BUF, MEM_DREAD_CTRL, MEM_DWRITE_Q, MEM_MD5_DIGEST, memDataInit(), Mgr::RegisterAction(), Mem::Allocator::setChunkSize(), SQUID_MD5_DIGEST_LENGTH, and Stats().
Referenced by commonInit(), TestUfs::commonInit(), fake_auth_setup(), TestHttp1Parser::globalSetup(), main(), SquidMain(), MyTestProgram::startup(), and TestSBuf::testSBufConstructDestructAfterMemInit().
◆ PoolReport()
Definition at line 581 of file old_api.cc.
References Mem::PoolMeter::alloc, Mem::PoolMeter::mgb_t::bytes, Mem::PoolStats::chunk_capacity, Mem::PoolStats::chunks_alloc, Mem::PoolStats::chunks_free, Mem::PoolStats::chunks_inuse, Mem::PoolStats::chunks_partial, Mem::PoolMeter::mgb_t::count, Mem::Meter::currentLevel(), Mem::PoolMeter::gb_allocated, Mem::PoolMeter::gb_oallocated, Mem::PoolMeter::gb_saved, Mem::PoolMeter::idle, int, Mem::PoolMeter::inuse, Mem::PoolStats::items_alloc, Mem::PoolStats::items_idle, Mem::PoolStats::items_inuse, Mem::PoolStats::label, Mem::PoolStats::meter, Mem::PoolStats::obj_size, Mem::Meter::peak(), Mem::Meter::peakTime(), squid_curtime, toKB, xdiv(), xm_deltat, and xpercent().
Referenced by Report().
◆ Report()
void Mem::Report | ( | std::ostream & | stream | ) |
Definition at line 651 of file old_api.cc.
References Mem::PoolMeter::mgb_t::bytes, Mem::PoolMeter::mgb_t::count, current_dtime, Mem::Meter::currentLevel(), double_to_str(), Mem::PoolMeter::gb_allocated, MemPools::GetInstance(), GlobalStats(), Mem::PoolMeter::inuse, Mem::Allocator::meter, Mem::PoolStats::meter, Mem::PoolStats::overhead, Mem::PoolStats::pool, PoolReport(), MemPools::pools, toMB, xm_deltat, xm_time, and xpercent().
Referenced by Stats().
◆ Stats()
void Mem::Stats | ( | StoreEntry * | sentry | ) |
Definition at line 165 of file old_api.cc.
References DBG_IMPORTANT, debugs, memBufStats(), memStringStats(), and Report().
Referenced by Init(), DelayPools::RegisterWithCacheManager(), and Rock::Rebuild::Stats::SharedMemorySize().
◆ ZeroSensitiveMemory()
|
inline |
zeros the given memory area while disallowing the compiler to skip (i.e. optimize away) this cleanup, unlike a regular call to std::memset() or alike
Definition at line 19 of file Sensitive.h.
References assert.
Referenced by nmasldap_get_password(), and nmasldap_get_simple_pwd().