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(OwnsBAZEL_WORKER,BAZEL_TEST, and unclassified sandboxed descendants rolled intoSubtreeRSSMemoryMB,SubtreeCPUPercent,ActiveWorkerCount, andActiveSandboxedActionCount)
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 liveparentPidlinks, 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, andPhysicalFootprintBytes. - Desktop: Sums
rssMemoryMbandcpuPercent. - 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/groupedtracking). - 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, andmax_parallelismare 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.