async-profiler is a low-overhead sampling profiler for Java and native applications on Linux/macOS. It runs as a native JVM agent (libasyncProfiler.so/.dylib) loaded via -agentpath at JVM startup, or attached to a running JVM through its own C++ launcher `asprof` using an embedded jattach implementation. The core engine (src/profiler.cpp) orchestrates multiple sampling engines — perf_event_open-based CPU sampling, POSIX interval timers, wall-clock thread sampling, JVMTI allocation hooks with int3 breakpoint traps, and malloc/lock interception — then walks Java and native stacks using frame-pointer, DWARF, and HotSpot VMStructs-based unwinders. Sampled call traces are deduplicated in a lock-free CallTraceStorage and emitted as Java Flight Recorder (JFR) files, interactive HTML flame graphs, collapsed stacks, OpenTelemetry (OTLP) protobuf, pprof, or heatmaps. Architecturally this is a native library + CLI tool + standalone Java converter, not a service. The agent entry points are in src/vmEntry.cpp (JVMTI: Agent_OnLoad, Agent_OnAttach), the CLI in src/main/main.cpp, and the programmatic API in src/api/one/profiler/AsyncProfiler.java with a companion JMX MBean. A separate Java application (src/converter) parses JFR output — JfrReader.java is a full binary JFR parser — and transforms it into flame graphs, differential visualizations, heatmaps (using a custom LZ78-like tree plus Huffman encoding), and OTLP profiles. The codebase depends deeply on Linux kernel facilities (perf_event_open, /proc, signals) and on HotSpot internals such as AsyncGetCallTrace and hand-maintained VMStructs offset tables; the latter is the primary source of cross-JDK maintenance risk. Although the dominant character is a profiling tool/agent, the JFR converter and heatmap/flamegraph generators give the repo an analytical data-processing flavor that is embedded in the tool's output pipeline rather than a separate research workflow. Strengths: exceptional systems craftsmanship throughout — signal-safe memory allocation via raw syscalls, lock-free append-only dictionaries and linear allocators, a standalone Rust symbol demangler, a from-scratch protobuf wire-format writer, architecture-specific stack unwinders, and a self-contained test harness that spawns real JVMs. The project is actively maintained, runs integration tests across JDK 8–25 and multiple distributions in CI, and publishes nightly releases. Weaknesses are inherent to the domain: fragile hand-maintained JVM internals, heavy platform #ifdef sprawl across x64/aarch64/arm/ppc64/riscv64/loongarch64, some commented-out tests pending tiered CI re-enablement, and experimental features (OTLP output, --all multi-event mode) explicitly flagged unstable.
pprof is a mature, production-grade profiling visualization and analysis tool for Go, C++, Java, and other languages that export profiles in the pprof protobuf format. It operates as both a command-line tool and an interactive web server, allowing users to inspect CPU, memory, contention, and goroutine profiles. The core architecture is a modular Go application: the `driver` package orchestrates fetching, symbolization, merging, and report generation; the `profile` package provides a standalone library for reading, writing, and manipulating profiles; the `graph` package builds weighted directed call graphs; and the `report` package outputs a variety of formats including text, SVG dot graphs, HTML flame graphs, annotated source, disassembly, and more. External dependencies include binutils (addr2line, nm, objdump) for local symbolization, Graphviz (dot) for graph rendering, and optionally Chrome for browser tests. The system supports profile comparison, filtering by tags or sample labels, and can symbolize using local binaries or remote symbolz services. The profile package is designed for reuse as a standalone library, making pprof useful both as a tool and as a data processing foundation for other profiling tooling.
d3-flame-graph is a D3.js library for creating interactive flame graphs from hierarchical data. It follows the D3 chart pattern with a closure-based factory function that returns a configurable chart function. The library processes JSON input data representing call stacks or hierarchies and renders them as SVG flame graphs with features like zoom, search, tooltips, and click/hover handlers. It includes specialized color mappers for different profiling contexts (allocation, off-CPU, Node.js, differential) and a smart tooltip component that handles boundary conditions. The architecture is modular with separate concerns for color mapping, tooltip handling, and core layout logic.
Parca is a continuous profiling platform that collects, stores, queries, and visualizes pprof profiles in real time. The Go backend ingests profiles via gRPC (both pprof and OpenTelemetry OTLP), normalizes them into Apache Arrow columnar format, and stores them in either FrostDB (default) or ClickHouse. It provides a rich gRPC+JSON API for querying profiles (flamegraph, table, source view, callgraph, pprof download), scraping Prometheus-style targets, managing debug information for symbolization, and sharing profiles via links. The TypeScript/React frontend delivers an interactive profiling UI with flamegraphs, tables, source views, metrics graphs, sandwich views, and comparison mode, all backed by efficient Arrow-based querying. The codebase demonstrates strong engineering with reusable patterns (generic caching, signed request abstraction, Arrow compaction), but carries some drift risk from dual storage backends, generated protobuf code, and a complex UI state layer built with multiple state management strategies.