Skip to content

Process hierarchy

Build tools frequently spawn short-lived or persistent child processes—such as Gradle test workers, Kotlin compiler daemons, or Xcode Swift/Clang compilers. Daemonitor tracks parent-child ownership so you can inspect either flat processes or grouped build trees without double-counting resources.

Hierarchy roots

Three build-system roots organize process trees and resource ownership:

  • GRADLE_DAEMON (Grouped view root in Desktop and TUI)
  • XCODE_BUILD_SERVICE (Grouped view root in Desktop and TUI)
  • BAZEL_SERVER (Owns BAZEL_WORKER, BAZEL_TEST, and unclassified sandboxed descendants rolled into SubtreeRSSMemoryMB, SubtreeCPUPercent, ActiveWorkerCount, and ActiveSandboxedActionCount)

Roots are never nested inside another root. Any non-root process whose ancestor chain reaches a live root is grouped under that root.

Reparenting and identity handling

  • Go TUI (cored/internal/tui/hierarchy.go): Continuously observes (pid, startTimeMs) parent links even while in Flat mode. Once a child's parent is recorded, it is remembered across transient reparenting until the child's own (pid, startTimeMs) disappears.
  • Desktop UI (LiveProcessGrouping.kt): Computes grouping per snapshot from live parentPid links, preserving multi-level indentation depth (depth = 1, 2, ...).

Own-process vs. aggregated measurements

When Grouped view is active:

  • Group root rows display aggregated sums across the root plus all owned descendants:
  • TUI: Sums RSSMemoryMB, CPUPercent, and PhysicalFootprintBytes.
  • Desktop: Sums rssMemoryMb and cpuPercent.
  • Non-additive fields on the root row (such as PID, Heap used, XMX, and GC counters) remain the root's own values.
  • Child rows always display their own individual measurements.

Double-counting prevention

  • Each discovered process is emitted at most once in the rendered table (groupedRoots / grouped tracking).
  • Top-level summary totals (such as total RSS in the Desktop summary strip or TUI header) sum each live process once—never adding an aggregated group row on top of its children.
  • In observation sessions (cored/internal/sessions/sessions.go), total_peak_rss_mb, total_peak_footprint_bytes, and max_parallelism are computed per sample timestamp (taking the maximum simultaneous sum across poll ticks) so sequential non-overlapping compiler processes are never summed into an inflated peak.