Tagged articles
memory-management
56 articles · Page 1 of 1
This article explores common pitfalls when using std::shared_ptr in C++, including unnecessary copying, extra heap allocations, cyclic references, and subtle memory retention with make_shared, provides benchmark comparisons, and offers practical guidelines such as preferring const‑reference passing, using std::make_shared, and employing weak_ptr to break cycles.
C++memory-managementperformance
0 likes · 10 min read

The article explains how Go 1.22’s new experimental arena feature provides deterministic, zero‑GC memory management similar to Rust’s ownership model, compares the two languages’ approaches, shows practical code examples, and discusses the impact on backend development performance and safety.
Arenamemory-managementperformance
0 likes · 8 min read

This guide explains how to safely process massive files in PHP by reading them line‑by‑line with fread (or fgets), offering practical code, memory‑saving techniques, buffer usage, file seeking, and PHP.ini adjustments to prevent out‑of‑memory errors.
Backendfile handlingfread
0 likes · 4 min read

This article presents eight high‑frequency embedded‑system interview questions, explains the underlying concepts such as boot process, interrupt handling, stack overflow detection, struct alignment, bit‑banding, dynamic memory risks, volatile usage, and provides concise C code examples and best‑practice answers to help candidates succeed in technical interviews.
C++Cortex-MEmbedded
0 likes · 8 min read

Discover a comprehensive guide to dramatically improve Python program speed and memory usage through algorithmic refinements, profiling tools, concurrency models, and advanced techniques like generators, slots, and third‑party libraries, complete with real‑world code examples and performance benchmarks.
Concurrencymemory-managementoptimization
0 likes · 19 min read

This comprehensive guide explains CGO fundamentals, demonstrates basic and advanced usage with practical code examples, covers type conversion, calling C standard libraries, handling external C files, callbacks, struct passing, memory‑management best practices, real‑world scenarios, limitations, and alternative approaches for Go developers.
C integrationGoInterop
0 likes · 9 min read

Learn how hidden memory leaks, inefficient data structures, and poor import practices can slow Python scripts, and apply practical techniques—such as using weakref, generators, __slots__, lazy imports, and profiling tools—to dramatically reduce memory usage and speed up execution.
best-practicesmemory-managementperformance-optimization
0 likes · 11 min read

This article explains why the Java OutOfMemoryError with reason stack_trace_with_native_method occurs when native method calls exhaust thread stack memory, and provides diagnostic steps and practical solutions such as analyzing stack traces, using OS tools, optimizing native code, adjusting JVM memory settings, and avoiding recursive native calls.
memory-managementnative-methods
0 likes · 4 min read

This article explains how to efficiently read large files in PHP by using the fread function to process the file line by line, includes code examples, and discusses additional techniques such as buffering, fseek positioning, and increasing memory limits to avoid memory overflow.
BackendLarge Filesfile-handling
0 likes · 4 min read

This article demonstrates how Python generator functions can be applied in API automation testing to process large data streams, batch requests, infinite sequences, file handling, dynamic test data generation, recursive file traversal, lazy calculations, data filtering, response processing, retry logic, and test report creation, thereby improving memory efficiency and test flexibility.
api-testinggeneratormemory-management
0 likes · 6 min read

This article explains common causes of Java OutOfMemoryError, demonstrates how to reproduce OOM with sample code, and provides step‑by‑step techniques using jmap, heap dumps, and VisualVM to locate and avoid memory leaks in backend applications.
BackendOOMdiagnostics
0 likes · 6 min read

This article presents practical Go performance tips, covering memory‑allocation strategies, slice and map pre‑allocation, stack management, GC reduction, goroutine‑pool usage, avoiding blocking syscalls, and efficient string handling to minimize latency and resource consumption.
memory-managementperformance
0 likes · 10 min read

This guide explains Linux memory management fundamentals and provides step‑by‑step commands for safely clearing RAM caches, file system buffers, and swap space, while highlighting the risks of doing so on production servers and offering advanced tuning techniques.
Swapcache clearingmemory-management
0 likes · 10 min read

This article explains why and how the Go runtime’s garbage collector can skip scanning objects that contain no pointers, describes the noscan flag and its implementation in the GC pipeline, shows benchmark results, and offers practical tips for leveraging this optimization in real‑world code.
GCmemory-managementnoscan
0 likes · 21 min read

This article explains how Linux reports memory usage, clarifies the meaning of free, buffers, cache, and available fields, details /proc/meminfo entries, distinguishes page‑cache, buffer‑pages, shared memory, and shows how process‑level tools like smaps and top present memory statistics.
memory-managementpage-cacheprocfs
0 likes · 14 min read

This article explains how to efficiently read large files in PHP using the fread function line by line, providing code examples, buffering tips, fseek usage, and memory‑limit adjustments to avoid memory overflow while processing massive data streams.
Large Filesfile-handlingfread
0 likes · 4 min read

The article explains why the initial memset on a newly‑allocated 1 GB buffer is much slower than subsequent calls, detailing how page‑fault handling, TLB misses, and the MMU’s multi‑level page tables cause overhead, and demonstrates optimizations such as using huge pages, MAP_POPULATE, and pre‑mapping to eliminate the slowdown.
TLBhuge pagesmemory-management
0 likes · 20 min read

This article explains how PHP developers can use generators to iterate over large data sets without exhausting memory, covering the concept, syntax with the yield keyword, step‑by‑step examples, converting regular functions, handling key‑value pairs, sending data back, returning values, and a real‑world file‑reading use case.
BackendLarge Datagenerators
0 likes · 5 min read

This article explains Python's automatic garbage collection mechanisms, including reference counting and cyclic garbage collection, and presents ten practical code snippets demonstrating how to inspect reference counts, list objects, trace memory usage, and employ profiling tools such as tracemalloc, memory_profiler, pympler, and objgraph to detect leaks and optimize memory usage.
code-examplesgarbage-collectionmemory-management
0 likes · 4 min read


ByteFEJul 26, 2023 · Frontend Development
This comprehensive guide explains browser fundamentals, covering process and thread architecture, single‑ and multi‑process models, the V8 engine's data types, property ordering, memory allocation and garbage collection, compilation stages, the event loop, rendering pipeline, performance optimization techniques, and security mechanisms.
RenderingV8browser
0 likes · 43 min read

This article explains why Redis may show high OS‑allocated memory despite low data usage, describes the causes of memory fragmentation, and provides practical steps—including configuration changes and automatic defragmentation settings—to diagnose and mitigate fragmentation for stable performance.
Cachingdatabasesmemory fragmentation
0 likes · 9 min read

This article explores the design and implementation of MemoryLimitedLBQ and MemorySafeLBQ, two custom LinkedBlockingQueue variants that limit memory usage to avoid Out‑Of‑Memory errors in Java thread pools, comparing their mechanisms, instrumentation dependencies, and practical usage in open‑source projects.
ConcurrencyLinkedBlockingQueueinstrumentation
0 likes · 13 min read

This article presents a collection of common Python interview questions covering memory management mechanisms, lambda functions, tuple/list conversion, duplicate removal techniques, sorting tricks, object copying methods, exception handling, the pass statement, range usage, regex operations, match vs search differences, and random number generation, each accompanied by clear explanations and code examples.
Listexception-handlingmemory-management
0 likes · 10 min read

This article explains Linux virtual memory, the page‑fault allocation process, the two memory‑reclaim paths (kswapd and direct reclaim), OOM killer scoring, swappiness tuning, NUMA‑aware reclamation, and practical steps to protect critical processes from being killed.
LinuxNUMAOOM killer
0 likes · 19 min read

This article explains JavaScript's memory allocation across code, stack, and heap spaces, details how different data types are stored, describes garbage collection mechanisms, and provides practical steps to detect and fix memory leaks, including a React-specific example.
garbage-collectionmemory-leakmemory-management
0 likes · 18 min read

This article explains the misconception that manually assigning null to unused objects always helps Java garbage collection, demonstrates with concrete JVM examples how stack slots and reachability analysis affect object reclamation, and shows when null‑assignment or slot reuse actually makes a difference.
Javagarbage-collectionmemory-management
0 likes · 10 min read

This article provides an in‑depth exploration of Swift closures on iOS, covering their definition, three forms, practical use cases, underlying SIL generation, capture lists, context capture, storage mechanisms, escaping and autoclosure variants, and important memory‑management considerations such as reference cycles.
Capture Listautoclosureclosure
0 likes · 17 min read

This article explains Go 1.16's madvise integration, detailing the MADV_DONTNEED and MADV_FREE options, their impact on physical memory release, RSS reduction, and the underlying mmap-based heap allocation with code examples.
LinuxRSSmadvise
0 likes · 5 min read

This article explains how Linux manages process memory, covering allocation via mmap and brk, OOM killer selection, the role of page cache in different mapping types, manual and automatic memory reclamation, and related kernel parameters.
CacheOOMSwap
0 likes · 20 min read

This article explains how Flutter loads and caches images, analyzes the underlying source code of key classes such as PaintingBinding, ImageCache, ImageProvider, and RenderImage, and provides practical techniques for reducing memory usage and preventing OOM in large Flutter applications.
CachingFlutterimage loading
0 likes · 13 min read

This article analyzes a Meituan interview question about whether other threads can continue when one thread throws a Java OutOfMemoryError, explains different OOM types, provides a sample program that triggers heap OOM, and demonstrates that remaining threads keep running while memory is reclaimed.
MultithreadingOutOfMemoryErrormemory-management
0 likes · 5 min read


ITPUBApr 15, 2021 · Databases
This article explains how to set Redis's maximum memory usage via configuration files or runtime commands, details all built‑in eviction policies, demonstrates retrieving and changing these policies, and dives into the LRU and LFU algorithms—including Java sample code and Redis's approximate LRU implementation.
LFULRUdatabases
0 likes · 11 min read

This article explains the Java 8 memory architecture, detailing the differences between JVM-managed memory and native memory, describing each runtime data area such as the program counter, JVM stack, native method stack, heap, method area, and direct memory, and answering common questions about variable storage, native methods, literals and symbolic references.
Java8Runtime Data Areagarbage collection
0 likes · 13 min read

This guide explains how the Linux free command reports memory usage, clarifies the roles of total, used, free, buffers, and cache, describes the meaning of the -/+ buffers/cache line, and provides practical steps to clear swap and drop caches.
BuffersCacheSwap
0 likes · 6 min read

This article explains the JVM garbage collection mechanism, covering which memory areas are collected, how object reachability is determined, the main GC algorithms, generational collection theory, and JVM heap layout, providing essential knowledge for Java performance tuning.
GC algorithmsJVMJVM tuning
0 likes · 20 min read


ITPUBDec 12, 2020 · Operations
This article explains Linux's swapping mechanism, detailing how the kernel moves rarely used memory pages to disk to handle memory shortage and idle memory, the underlying allocation paths, key parameters, and the trade‑offs involved for system performance and stability.
Swappingmemory-managementoperating-system
0 likes · 11 min read

This article explains PHP's garbage collection mechanism, detailing how reference counting works, the role of zval structures, the identification and reclamation process, and provides source code insights to compare PHP's approach with Java's garbage collection.
PHPReference Countingbackend-development
0 likes · 9 min read

This article explains the distinct purposes, usage rules, and underlying bytecode behavior of Java's final, finally, and finalize keywords, covering class and method immutability, variable constancy, guaranteed execution blocks, deprecated finalization, and common performance misconceptions.
FinalFinalizeexception-handling
0 likes · 14 min read


ITPUBOct 13, 2020 · Fundamentals
This article provides a comprehensive, step‑by‑step explanation of Linux fundamentals—including the kernel architecture, process and thread creation, memory management, filesystem structures, I/O handling, and built‑in security mechanisms—illustrated with code snippets and diagrams.
FilesystemIOmemory-management
0 likes · 104 min read

This article demystifies Linux memory accounting by explaining the differences between RSS, free, buffers/cache, slab, and page tables, showing how to interpret the free command output, use tools like nmon and slabtop, and providing scripts to calculate actual memory consumption.
RSSSLABmemory-management
0 likes · 10 min read


ITPUBJul 3, 2020 · Fundamentals
This guide walks through Python file I/O by comparing manual Windows text handling to code, explains file handles, demonstrates reading and writing with various modes, clarifies read vs. readline vs. readlines, and shows how to efficiently process large files without exhausting memory.
PythonRead/Writefile-io
0 likes · 12 min read

This article demystifies the common advice of setting unused objects to null in Java by examining JVM garbage collection, runtime stack behavior, and stack slot reuse, demonstrating through code examples how null assignments or variable reuse affect object reclamation.
garbage-collectionmemory-managementnull assignment
0 likes · 9 min read

To handle the massive memory and CPU demands of modern front‑end map annotations, the article explains JavaScript’s stack‑heap model, object hash‑table storage, and the trade‑offs of plain arrays, TypedArray, DataView, and SharedArrayBuffer, showing that contiguous memory structures and Web‑Worker off‑loading dramatically improve performance and reduce allocations.
SharedArrayBufferTypedArrayWebWorker
0 likes · 17 min read

This article explains Java's garbage collection fundamentals, covering JVM memory layout, key heap parameters, object liveness determination, and the main GC algorithms—Mark‑Sweep, Copying, and Mark‑Compact—while providing practical insights for interview preparation.
AlgorithmsGCInterview
0 likes · 10 min read

This article examines whether PHP's unset() function truly frees memory by debunking common myths, demonstrating verification methods, analyzing the Zend engine's memory manager, and presenting practical code examples that reveal how different variable types affect memory usage after unsetting.
Zendmemory-managementunset
0 likes · 9 min read

This article explains how Java's String class encapsulates character arrays, the role of the string pool, the effects of the new operator, the intern() method, and the proper use of == versus equals() for reliable string comparison and memory optimization.
InternObject ComparisonString
0 likes · 8 min read

This article provides a comprehensive overview of Linux fundamentals, covering the kernel architecture, virtual memory management, process scheduling and inter‑process communication, the hierarchical file system and VFS layer, device drivers, networking, shell variants, partitioning, mounting, and essential command‑line tools.
MountProcess SchedulingVFS
0 likes · 33 min read

Explore core Python backend techniques—from efficient file reading with generators and iterator nuances, through memory management and the Global Interpreter Lock, to practical Django deployment, Nginx proxying, Tornado async I/O, essential Linux commands, and fundamental data structures and sorting methods.
Pythonmemory-managementperformance
0 likes · 13 min read

This article explains the internal C implementation of Python's list object, detailing the PyListObject struct, the PyList_New constructor, memory allocation strategies, the list_resize algorithm, the free‑list reuse scheme, and how common list operations like insert, append, extend, and delete are performed.
C APIListPython
0 likes · 8 min read

This article provides a comprehensive overview of Redis, explaining why it’s chosen for performance and concurrency, how its single‑threaded design achieves speed, the various data types and their use cases, expiration and eviction strategies, consistency challenges with databases, and solutions for cache penetration, avalanche, and key‑concurrency issues.
CachingConsistencydata-structures
0 likes · 15 min read

This article presents practical Java backend optimization techniques, covering servlet session memory management, JSP buffering, include strategies, efficient HashMap traversal, array versus ArrayList choices, and best practices for strings, splits, and general code performance.
JSPJavamemory-management
0 likes · 12 min read

This article compiles over ten essential Python interview questions covering memory management, lambda functions, data structure conversions, duplicate removal, sorting techniques, object copying, exception handling, pass statements, range usage, regex operations, random number generation, static analysis tools, global variables, and string quoting conventions.
Interviewcoding interviewlambda
0 likes · 11 min read

This article examines how PHP's foreach construct consumes memory under different reference modes, explains the internal structure of PHP arrays, buckets, and zvals, and provides practical recommendations for choosing reference or value iteration to minimize memory usage.
arraybackend-developmentforeach
0 likes · 17 min read

The article explains that in Java a single thread hitting stack limits triggers StackOverflowError, while true OutOfMemoryError arises only when multiple threads exhaust the operating system's memory, and it offers practical tips to mitigate such OOM situations.
JVMMultithreadingOutOfMemoryError
0 likes · 5 min read

This article presents a comprehensive set of Java performance optimization techniques, covering proper use of singletons, avoiding static variables, minimizing object creation, leveraging final modifiers, using local variables, selecting appropriate data structures, reducing synchronization, and employing efficient coding patterns such as System.arraycopy and bit‑shift operations.
Javabest-practicesmemory-management
0 likes · 17 min read

This tutorial explains how Java's automatic garbage collection works, covering the roles of System.gc(), memory regions such as Eden, Survivor and Old generations, reference types, object finalization, and includes code examples that illustrate GC eligibility and OutOfMemoryError scenarios.
FinalizeOutOfMemoryErrorgarbage-collection
0 likes · 10 min read
