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 247 of file old_api.cc.
References MemPools::clean(), clean_interval, eventAdd(), and MemPools::GetInstance().
Referenced by 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(), Mem::PoolStats::label, Mem::PoolStats::meter, Mem::PoolStats::obj_size, Mem::PoolStats::overhead, MemPools::pools, and TheMeter.
Referenced by DumpInfo(), GetInfo(), memClean(), Report(), and snmp_prfSysFn().
◆ Init()
void Mem::Init | ( | ) |
Then initialize all pools.
- Starting with generic buffer 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 281 of file old_api.cc.
References assert, GetPool(), MEM_128B_BUF, MEM_16K_BUF, MEM_1K_BUF, MEM_256B_BUF, MEM_2K_BUF, MEM_32B_BUF, MEM_32K_BUF, MEM_4K_BUF, MEM_512B_BUF, MEM_64B_BUF, MEM_64K_BUF, MEM_8K_BUF, MEM_MAX, MEM_MD5_DIGEST, MEM_NONE, memDataInit(), Mgr::RegisterAction(), Mem::Allocator::setChunkSize(), SQUID_MD5_DIGEST_LENGTH, and Stats().
Referenced by TestUfs::commonInit(), commonInit(), fake_auth_setup(), GetPool(), TestHttp1Parser::globalSetup(), SquidMain(), MyTestProgram::startup(), and TestSBuf::testSBufConstructDestructAfterMemInit().
◆ PoolReport()
Definition at line 478 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 548 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::PoolStats::meter, Mem::Allocator::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 77 of file old_api.cc.
References Mem::Meter::currentLevel(), DBG_IMPORTANT, debugs, HugeBufCountMeter, HugeBufVolumeMeter, 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().
Introduction
- About Squid
- Why Squid?
- Squid Developers
- How to Donate
- How to Help Out
- Getting Squid
- Squid Source Packages
- Squid Deployment Case-Studies
- Squid Software Foundation
Documentation
- Quick Setup
- Configuration:
- FAQ and Wiki
- Guide Books:
- Non-English
- More...
Support
- Security Advisories
- Bugzilla Database
- Mailing lists
- Contacting us
- Commercial services
- Project Sponsors
- Squid-based products