Tagged articles
object pool
30 articles · Page 1 of 1
This article explains CPU cache fundamentals, demonstrates common cache killers like row vs column traversal, vector vs list, and false sharing with benchmarks, and provides practical C++ optimization techniques including struct layout, AoS vs SoA, prefetching, pointer chasing avoidance, and object pools, emphasizing measurement with perf.
C++CPU cachedata layout
0 likes · 20 min read


liandkJun 25, 2026 · Fundamentals
This article introduces the Flyweight design pattern, explains its intrinsic and extrinsic state concepts, presents real-world use cases such as board games and text editors, and provides a complete Java implementation with an abstract piece, concrete piece, factory pool, and test demonstration, highlighting memory savings and potential pitfalls.
Design PatternMemory Optimizationflyweight
0 likes · 5 min read

The author recounts how a naïve generic C++ object pool caused data residue, construction failures, and incompatibility with primitive types, then demonstrates a refactored, thread‑safe pool that leverages compile‑time Type Traits, std::enable_if, and constexpr if to apply distinct creation, reset, and destruction logic for trivial, Clear‑able, and non‑trivial types, eliminating the earlier bugs.
C++Type Traitsobject pool
0 likes · 11 min read

The article explains why high‑concurrency programs suffer from memory fragmentation and system‑call overhead, compares memory pools and object pools, outlines their distinct use‑cases, provides step‑by‑step C and C++ implementations, and highlights optimization tips and common pitfalls.
C++high concurrencymalloc
0 likes · 20 min read

The article explains why indiscriminate use of the Java new operator leads to duplicated configuration, hidden complexity, and performance problems, and demonstrates how Factory, Builder, Object‑Pool, and Prototype patterns—illustrated with Spring Boot 3.5.0 code—provide clean, maintainable alternatives that distinguish junior from senior developers.
Builder PatternFactory PatternJava
0 likes · 19 min read

This article explains why C++ thread pools often hit bottlenecks in high‑concurrency scenarios and provides practical techniques—such as lock‑granularity tuning, lock‑free queues, object‑pool reuse, and pre‑allocation—to improve task scheduling and memory management without relying on external frameworks.
C++Concurrencylock-free queue
1 likes · 44 min read

This article explains why using the plain new operator is far faster than reflection, shows how an object pool can dramatically reduce memory usage and allocation time, and demonstrates a factory‑plus‑cache pattern that eliminates most repetitive new calls, delivering up to three‑fold performance gains.
BackendFactory PatternJava
0 likes · 6 min read

This article explains the object pool design pattern, its working mechanism, advantages and disadvantages, and provides step‑by‑step Java code using Apache Commons Pool along with real‑world examples for web servers and game development to improve performance and resource management.
Design Patternapache-commons-poolobject pool
0 likes · 14 min read

This article explains the principles of object pools, details the internal implementation of Go's sync.Pool, and demonstrates through benchmarks how using an object pool can dramatically reduce memory allocation and latency for high‑traffic menu services in a restaurant ordering application.
BenchmarkGohigh concurrency
0 likes · 13 min read

This article describes how to build a lightweight custom object pool in Java using a LinkedBlockingQueue and a factory interface, detailing its design, implementation, code examples, and a test script that demonstrates borrowing, returning, and size control of pooled objects.
ConcurrencyFactory PatternLinkedBlockingQueue
0 likes · 7 min read

This article walks through the design and implementation of a simple, thread‑safe object pool in Java using a LinkedBlockingQueue, explains the underlying concepts such as factory pattern and queue trimming, and provides a complete code example with a test script and output analysis.
BackendConcurrencyDesign Pattern
0 likes · 7 min read

This article explains the concept of object pools in Go, outlines their performance benefits, demonstrates how to implement pools using the standard sync.Pool and channel approaches with full code examples, and reviews several third‑party libraries for advanced pooling needs.
ConcurrencyGoobject pool
0 likes · 12 min read

This article explains how to use Apache Commons GenericObjectPool to implement a reusable process pool in Java, covering the underlying concepts, required dependencies, custom factory implementation, pool configuration, and example code for borrowing and returning pooled objects.
BackendGenericObjectPoolJava
0 likes · 9 min read

This article explores the motivation, design, implementation, and performance testing of a high‑performance object pool that reduces allocation overhead in multithreaded environments by using thread‑local storage, freelists, and lock‑optimized global resources.
C++ConcurrencyMultithreading
0 likes · 25 min read

This article explains what Netty is, why it’s essential for Java back‑end development, details its core components and high‑performance mechanisms such as the Reactor model, Zero‑Copy and object pooling, and shows how Netty handles TCP framing issues with practical decoding solutions.
JavaNettyReactor Pattern
0 likes · 9 min read

This article revisits Linux memory allocation, then dives deep into the slab allocator—explaining its relationship with the buddy system, its internal layout, the differences between slab, slub and slob, and how the kernel uses slab caches, per‑CPU caches, and NUMA nodes to efficiently allocate and free small memory objects.
LinuxSLUBkernel
0 likes · 66 min read

This article explains the object pool design pattern, its working mechanism, step‑by‑step Java implementation using Apache Commons Pool, advantages, drawbacks, and real‑world scenarios such as web server connection pooling and game object reuse, providing complete code examples.
Design PatternJavaapache-commons-pool
0 likes · 12 min read

The article introduces Pond, a high‑performance Python object‑pool library that reduces memory consumption and GC pressure by reusing objects, explains its design components, automatic eviction strategy, thread‑safe borrowing and returning mechanisms, and provides detailed usage examples with code snippets.
ConcurrencyLibraryobject pool
0 likes · 11 min read

This article explains the motivation behind object pooling in Java, walks through the core classes of Commons Pool 2 with a Jedis example, details key configuration parameters, presents JMH benchmark results that show a five‑fold throughput gain, and analyzes HikariCP’s design tricks and common interview questions about pool tuning.
Commons Pool 2Database ConnectionHikariCP
0 likes · 16 min read

This article demonstrates how to implement and benchmark Apache Commons Pool2's GenericKeyedObjectPool in Java, including factory creation, pool configuration, multithreaded performance tests with and without wait times, and analysis of results highlighting scalability limitations.
Apache Commons Pool2GenericKeyedObjectPoolJava
0 likes · 6 min read

This article examines why Netty has become the preferred high‑performance server framework over Tomcat, covering Java I/O models, zero‑copy techniques, off‑heap memory usage, and Netty’s custom object‑pooling, and explains how these features enable handling thousands of concurrent connections efficiently.
Java NetworkingNettyOff-heap Memory
0 likes · 8 min read

This article explains the concept of object pools, introduces Apache Commons Pool2 core interfaces and object states, details configuration parameters, describes the borrowing and returning workflow, and provides a complete Java example of a simple string pool implementation.
Apache Commons Pool2ConcurrencyJava
0 likes · 19 min read

This article explains the concepts, core interfaces, object states, borrowing and returning processes, configuration options, and step‑by‑step usage of Apache Commons Pool2, including a complete example of a simple string pool with code snippets and best‑practice tips.
Apache Commons Pool2Javaobject pool
0 likes · 17 min read

The article presents a high‑performance, thread‑safe object pool that combines thread‑local freelists, a global pool, and cache‑line‑aligned structures to reuse expensive objects, dynamically expand capacity, and achieve 50‑70% lower allocation latency than standard malloc/free and existing pool implementations.
C++lock optimizationobject pool
0 likes · 23 min read

This article investigates a socket memory leak on a single server using Jedis, revealing how frequent pool eviction, mis‑configured minIdle settings, and Java finalizer behavior combine to create excessive socket objects and strain the garbage collector.
Commons-PoolGCJava
0 likes · 8 min read

This article explains what a sync.Pool object pool is, when it should be used, details the Go 1.12 implementation with its internal structures and algorithms, describes the enhancements introduced in Go 1.13, and analyzes the resulting performance improvements for high‑concurrency backend applications.
ConcurrencyGoobject pool
0 likes · 18 min read

This article explains Python's integer object implementation, detailing how small integers are cached in a fixed‑size pool, how larger integers are managed through a dynamic PyIntBlock structure, and why using xrange (or range in Python 3) avoids memory bloat.
CPythoninteger objectmemory management
0 likes · 9 min read

The article examines Uber’s high‑throughput Go logging library zap, detailing its structured‑logging design, separation of concerns, copy‑on‑write filtering, extensive sync.Pool object reuse, reflection‑free type‑specific encoding, dynamic HTTP level control, and supplemental features such as a sugar API and log‑rotation, which together deliver superior performance over traditional libraries.
ConcurrencyGoLogging
0 likes · 18 min read


21CTOAug 17, 2015 · Backend Development
Learn how to improve Java application performance and achieve high throughput by understanding critical paths, using buffers for I/O, leveraging caching frameworks, implementing object reuse pools, and applying space‑time trade‑off techniques, all illustrated with practical code examples and performance comparisons.
BufferingJavaobject pool
0 likes · 21 min read


21CTOAug 10, 2015 · Backend Development
This article explains how to improve the throughput and response time of Java systems by using buffers, caches, object‑reuse pools, and time‑space trade‑off algorithms, providing concrete code examples and performance measurements for each technique.
BufferingJavahigh-throughput
0 likes · 20 min read
