Click here to Skip to main content
15,886,845 members
Articles / General Programming / Memory Management

Robust C++: Object Pools

Rate me:
Please Sign up or sign in to vote.
4.83/5 (17 votes)
5 Mar 2022GPL313 min read 43.3K   516   31  
Recovering from memory leaks
When a system runs for a long time, using a shared heap can eventually result in a crash because of gradual fragmentation and memory leaks. By allocating objects from pools of fixed-size blocks, a system can limit fragmentation and use a background garbage collector to recover leaked blocks. This article presents an ObjectPool class that provides these capabilities.

Views

Daily Counts

Downloads

Weekly Counts

License

This article, along with any associated source code and files, is licensed under The GNU General Public License (GPLv3)


Written By
Architect
United States United States
Author of Robust Services Core (GitHub) and Robust Communications Software (Wiley). Formerly Chief Software Architect of the core network servers that handle the calls in AT&T's wireless network.

Comments and Discussions