Complete Node.js & Libuv Runtime Visualizer

Master the Node.js & Libuv Engine.

Interactive visualizers for the 6-phase Libuv event loop, thread pool offloading, streams backpressure, V8 generational garbage collection, EventEmitter memory leaks, and clustering.

Libuv Asynchronous Runtime

The 6-Phase Libuv Event Loop & Microtask Interleaving

Phase 1 of 6: 1. Timers Phase
VIP Microtask Checkpoint: process.nextTick & Promise.then queues drain between every single phase!
Active Phase Inspection:

1. Timers Phase

setTimeout() & setInterval()

Executes expired timer threshold callbacks. Threshold represents the minimum delay, not exact guarantee.

Representative Handles Processed:
setTimeout(cb, 100) • setInterval(tick, 1000)
Libuv Thread Architecture

UV_THREADPOOL_SIZE & Asynchronous Worker Offloading

UV_THREADPOOL_SIZE = 4
V8 Main Thread (Single JS Stack)100% Non-Blocking

Executes all your JavaScript code. When asynchronous fs, crypto, or zlib functions are called, V8 offloads the synchronous blocking C syscall to Libuv and immediately returns.

Main Thread Status: FREE ⚡
Accepting incoming HTTP sockets on epoll...
Libuv Thread Pool (C/C++ Workers)4 Threads
Thread #1
💤 IDLE
Thread #2
💤 IDLE
Thread #3
⚡ RUNNING
Thread #4
⚡ RUNNING
Thread Pool Log: Click "Dispatch 4 Heavy Crypto Tasks" to simulate thread saturation.
High-Throughput I/O Architecture

Node.js Streams & Backpressure Flow Simulator

Status: FLOWING
Readable Stream
fs.createReadStream
▶️ PUSHING DATA
Internal Buffer
highWaterMark: 16 KB
12 KB / 16 KB
Writable Stream
fs.createWriteStream / Socket
Writing to disk / network
Buffer Fill Level:75%
Stream Event: Readable stream pushing 4KB chunks into Writable stream buffer.
V8 Engine Memory Architecture

V8 Generational Garbage Collector (Scavenger vs Mark-Sweep)

Generational Hypothesis: Most objects die young
Young Generation (1MB - 64MB)
Cheney Semi-Spaces
req_ctx_1(16KB)
Age: 0/2ALIVE
temp_buffer_2(32KB)
Age: 0/2DEAD
Old Generation (Up to 1.4GB)
Mark-Sweep-Compact
global_cache(128KB)
⭐ PROMOTED
V8 Memory Log:

Allocate objects or run Minor Scavenger GC to see Cheney semi-space copy and Old Gen promotion.

Core Runtime Architecture

EventEmitter Listener Lifecycle & Memory Leak Simulator

2 / 10 Listeners (8 KB RAM)
Registered Event Handlers:Event: "request"
logRequest()(4KB)
named
authGuard()(4KB)
named
EventEmitter Engine Log:

EventEmitter initialized with 2 listeners. Max warning threshold: 10.

Multi-Core Scale Architectures

Node.js Clustering vs Worker Threads

Multi-Process vs Multi-Thread
Architecture Diagram:cluster
Primary Master Process (PID: 1000) [Port 3000 IPC Router]
Worker #1 (PID: 1001)
Isolated 64MB RAM
Worker #2 (PID: 1002)
Isolated 64MB RAM
When to Use Which:

Clustering: Web Server Throughput

Ideal for web applications (Express, Fastify, NestJS) where each process independently handles non-blocking HTTP requests across all CPU cores.

Memory Sharing: ❌ No (Use Redis for sessions)
Interactive Node.js Sandbox

Node.js Script Runner & Event Loop Execution Tracer

Node v22 LTS Engine • V8 + Libuv
JavaScript Code (Node.js API):Click “Execute Script” to simulate
Presets:
node script.js stdout:Execution: 0.04 ms
>1. Sync Start
>1.5. Sync End
>2. process.nextTick (VIP Queue)
>3. Promise.then (Microtask)
>5. setTimeout (Timers Phase)
>4. setImmediate (Check Phase)