Skip to content

Bazel native processes

Bazel builds frequently execute non-JVM workers, native tests, and sandboxed C++/Swift/Rust/Go compiler actions. Daemonitor classifies these with runtime: NATIVE and bypasses JVM probing completely.

Individually discovered native processes

Process Process type Classification How it is identified
Swift persistent worker BAZEL_WORKER BAZEL / NATIVE / SWIFT --persistent_worker matching rules_swift, SwiftWorker, or swift_worker
Test wrapper scripts BAZEL_TEST BAZEL / NATIVE tools/test/test-setup.sh or sandbox wrappers (sandbox-exec, linux-sandbox, process-wrapper)
Promoted native test leaves BAZEL_TEST BAZEL / NATIVE Unclassified Bazel descendant (not --persistent_worker, with sandbox dir + .runfiles) having a BAZEL_TEST ancestor (PromoteBazelNativeTest)

Live JVM heap probing (ShouldProbeLiveHeapForProcess) requires both runtime == JVM and a JVM executable (java/javaw), so native workers and shell wrappers never trigger jcmd or jstat.

Sandboxed actions and subtree rollups

Short-lived compiler and linker invocations (such as clang, clang++, swiftc, rustc, ld) running inside Bazel sandboxes are not all promoted to standalone top-level rows:

  • Unclassified Bazel descendants are sampled cheaply for RSS and CPU only (sampleBazelDescendant).
  • Their resource usage is rolled into the owning BAZEL_SERVER's SubtreeRSSMemoryMB and SubtreeCPUPercent.
  • BAZEL_SERVER tracks ActiveSandboxedActionCount deduplicated per sandbox wrapper (sandbox-exec, linux-sandbox, process-wrapper), falling back to compiler PIDs or top-level BAZEL_TEST processes.

UI presentation and CLI filtering

When a Bazel section contains both JVM processes (such as BAZEL_SERVER and Java worker) and native processes (such as Swift worker or native BAZEL_TEST), Desktop and TUI automatically switch the Bazel section to the Mixed column layout (Type, Runtime, PID, RSS, Threads, CPU, Uptime, Project).

# Inspect Bazel processes (including Swift workers and native tests)
daemonitor-cli ps --ecosystem bazel --details