From f89cd916b53852e04e348629d37742b3e45f7d2c Mon Sep 17 00:00:00 2001 From: xstoicunicornx Date: Mon, 21 Sep 2026 05:14:01 +0000 Subject: [PATCH 1/3] net: report Darwin resident size on ibd: sizes and tip: perf read_proc_rss only read /proc/self/status and /proc/self/smaps_rollup, so on Darwin both reads missed and every memory field logged zero while the process held hundreds of MiB. Fill rss from proc_pid_rusage there. RUSAGE_INFO_V0 carries no anon/file split and no resident peak, so those fields stay zero on Darwin. The only lifetime peak available is over phys_footprint, which excludes clean file-backed pages and can read below a mapped-file RSS, so it is not wired to hwm. --- crates/rbitcoin-net/Cargo.toml | 5 +++ crates/rbitcoin-net/src/ibd/perf_log.rs | 49 +++++++++++++++++++++---- 2 files changed, 47 insertions(+), 7 deletions(-) diff --git a/crates/rbitcoin-net/Cargo.toml b/crates/rbitcoin-net/Cargo.toml index 21dfc3b46..1db5f680c 100644 --- a/crates/rbitcoin-net/Cargo.toml +++ b/crates/rbitcoin-net/Cargo.toml @@ -25,5 +25,10 @@ sha3 = "0.12" # POLLRDHUP: peer FIN with unread bytes still in the receive buffer. libc = "0.2" +[target.'cfg(target_os = "macos")'.dependencies] +# proc_pid_rusage: resident size for `ibd: sizes` / `tip: perf`; Darwin +# has no /proc. +libc = "0.2" + [lints] workspace = true diff --git a/crates/rbitcoin-net/src/ibd/perf_log.rs b/crates/rbitcoin-net/src/ibd/perf_log.rs index 332d1c038..d0565a3dc 100644 --- a/crates/rbitcoin-net/src/ibd/perf_log.rs +++ b/crates/rbitcoin-net/src/ibd/perf_log.rs @@ -676,12 +676,21 @@ pub struct ProcRss { pub locked_kb: u64, } -/// Cheap once-per-tick `/proc` read (not hot path). +/// Cheap once-per-tick resident-size read (not hot path). /// /// Prefer `/proc/self/status` fields present on modern kernels (`RssAnon` / /// `RssFile` / `VmRSS`). Fall back to `smaps_rollup` (`Anonymous:`, `Rss:`, /// `Locked:`) when status split is missing — older rollups do **not** expose /// `RssAnon:` / `RssFile:` (that bug made `ibd: sizes` print `anon=0 file=0`). +/// +/// Darwin has no `/proc`, so both reads miss and `proc_pid_rusage` fills +/// `rss` instead. That flavor carries no anon/file resident split and no +/// resident peak, so `anon` / `file` / `hwm` / `locked` stay zero there: the +/// `ibd: sizes` `residual≈` heap cross-check (anon minus accounted) and the +/// `hwm=` peak are Linux-only. Darwin's only lifetime peak is over +/// `phys_footprint`, which excludes clean file-backed pages and so can read +/// below a mapped-file RSS — a "peak" under the current value is worse than +/// none, so it is not wired to `hwm`. pub fn read_proc_rss() -> ProcRss { let mut out = ProcRss::default(); if let Ok(s) = std::fs::read_to_string("/proc/self/status") { @@ -690,9 +699,28 @@ pub fn read_proc_rss() -> ProcRss { if let Ok(s) = std::fs::read_to_string("/proc/self/smaps_rollup") { fill_rss_from_smaps_rollup(&mut out, &s); } + #[cfg(target_os = "macos")] + fill_rss_from_rusage(&mut out); out } +#[cfg(target_os = "macos")] +fn fill_rss_from_rusage(out: &mut ProcRss) { + let mut info: libc::rusage_info_v0 = unsafe { std::mem::zeroed() }; + // SAFETY: RUSAGE_INFO_V0 selects the `rusage_info_v0` layout being written + // here; an unsupported flavor returns non-zero without touching `info`. + let rc = unsafe { + libc::proc_pid_rusage( + std::process::id() as libc::c_int, + libc::RUSAGE_INFO_V0, + std::ptr::addr_of_mut!(info).cast(), + ) + }; + if rc == 0 { + out.rss_kb = info.ri_resident_size / 1024; + } +} + fn fill_rss_from_status(out: &mut ProcRss, s: &str) { for line in s.lines() { if let Some(rest) = line.strip_prefix("VmRSS:") { @@ -2574,14 +2602,21 @@ mod tests { assert_eq!(r.file_kb, 500); } + #[cfg(any(target_os = "linux", target_os = "macos"))] #[test] - fn read_proc_rss_returns_nonzero_on_linux() { + fn read_proc_rss_reports_resident_size() { let r = read_proc_rss(); - // Agent VM is Linux with /proc; RSS should be readable for this process. - assert!( - r.rss_kb > 0, - "expected VmRSS from /proc/self/status, got {r:?}" - ); + // Linux reads /proc/self/status; Darwin reads proc_pid_rusage. + // A live test process is resident either way. + assert!(r.rss_kb > 0, "expected a resident size, got {r:?}"); + } + + #[cfg(target_os = "linux")] + #[test] + fn read_proc_rss_splits_anon_and_file_on_linux() { + let r = read_proc_rss(); + // VmHWM is a high-water mark, so it never trails current residency. + assert!(r.hwm_kb >= r.rss_kb, "hwm should not trail rss, got {r:?}"); // Modern kernels expose RssAnon/RssFile on status; at least one side // of the split should be non-zero for a running process with heap+.text. assert!( From 639673dd526ad9bc23debfce8c9c8b068fb5433c Mon Sep 17 00:00:00 2001 From: xstoicunicornx Date: Mon, 21 Sep 2026 14:41:38 +0000 Subject: [PATCH 2/3] net: gate the /proc rss read to linux read_proc_rss ran the two /proc reads on every platform and relied on the opens failing off Linux. Split it into one read_platform_rss per target so Darwin and Windows stop issuing two doomed opens on each 5s sample. fill_rss_from_status, fill_rss_from_smaps_rollup and parse_kb_field parse /proc text and now carry the same gate, as does the test covering their edge cases; they would otherwise be dead code where warnings are denied. --- crates/rbitcoin-net/src/ibd/perf_log.rs | 40 ++++++++++++++++++++----- 1 file changed, 32 insertions(+), 8 deletions(-) diff --git a/crates/rbitcoin-net/src/ibd/perf_log.rs b/crates/rbitcoin-net/src/ibd/perf_log.rs index d0565a3dc..7abd60f02 100644 --- a/crates/rbitcoin-net/src/ibd/perf_log.rs +++ b/crates/rbitcoin-net/src/ibd/perf_log.rs @@ -678,20 +678,30 @@ pub struct ProcRss { /// Cheap once-per-tick resident-size read (not hot path). /// -/// Prefer `/proc/self/status` fields present on modern kernels (`RssAnon` / -/// `RssFile` / `VmRSS`). Fall back to `smaps_rollup` (`Anonymous:`, `Rss:`, -/// `Locked:`) when status split is missing — older rollups do **not** expose -/// `RssAnon:` / `RssFile:` (that bug made `ibd: sizes` print `anon=0 file=0`). +/// One platform arm compiles at a time: Linux reads `/proc`, Darwin asks +/// `proc_pid_rusage`, anything else (Windows) has neither and reports zeros. +/// Gating beats letting a missing `/proc` fail at runtime — it keeps non-Linux +/// hosts from two doomed `open` calls on every 5s sample. /// -/// Darwin has no `/proc`, so both reads miss and `proc_pid_rusage` fills -/// `rss` instead. That flavor carries no anon/file resident split and no -/// resident peak, so `anon` / `file` / `hwm` / `locked` stay zero there: the +/// Linux prefers `/proc/self/status` fields present on modern kernels +/// (`RssAnon` / `RssFile` / `VmRSS`), falling back to `smaps_rollup` +/// (`Anonymous:`, `Rss:`, `Locked:`) when the status split is missing — older +/// rollups do **not** expose `RssAnon:` / `RssFile:` (that bug made +/// `ibd: sizes` print `anon=0 file=0`). +/// +/// Darwin gets `rss` only. That flavor carries no anon/file resident split and +/// no resident peak, so `anon` / `file` / `hwm` / `locked` stay zero there: the /// `ibd: sizes` `residual≈` heap cross-check (anon minus accounted) and the /// `hwm=` peak are Linux-only. Darwin's only lifetime peak is over /// `phys_footprint`, which excludes clean file-backed pages and so can read /// below a mapped-file RSS — a "peak" under the current value is worse than /// none, so it is not wired to `hwm`. pub fn read_proc_rss() -> ProcRss { + read_platform_rss() +} + +#[cfg(target_os = "linux")] +fn read_platform_rss() -> ProcRss { let mut out = ProcRss::default(); if let Ok(s) = std::fs::read_to_string("/proc/self/status") { fill_rss_from_status(&mut out, &s); @@ -699,11 +709,21 @@ pub fn read_proc_rss() -> ProcRss { if let Ok(s) = std::fs::read_to_string("/proc/self/smaps_rollup") { fill_rss_from_smaps_rollup(&mut out, &s); } - #[cfg(target_os = "macos")] + out +} + +#[cfg(target_os = "macos")] +fn read_platform_rss() -> ProcRss { + let mut out = ProcRss::default(); fill_rss_from_rusage(&mut out); out } +#[cfg(not(any(target_os = "linux", target_os = "macos")))] +fn read_platform_rss() -> ProcRss { + ProcRss::default() +} + #[cfg(target_os = "macos")] fn fill_rss_from_rusage(out: &mut ProcRss) { let mut info: libc::rusage_info_v0 = unsafe { std::mem::zeroed() }; @@ -721,6 +741,7 @@ fn fill_rss_from_rusage(out: &mut ProcRss) { } } +#[cfg(target_os = "linux")] fn fill_rss_from_status(out: &mut ProcRss, s: &str) { for line in s.lines() { if let Some(rest) = line.strip_prefix("VmRSS:") { @@ -740,6 +761,7 @@ fn fill_rss_from_status(out: &mut ProcRss, s: &str) { } } +#[cfg(target_os = "linux")] fn fill_rss_from_smaps_rollup(out: &mut ProcRss, s: &str) { for line in s.lines() { if let Some(rest) = line.strip_prefix("Rss:") { @@ -767,6 +789,7 @@ fn fill_rss_from_smaps_rollup(out: &mut ProcRss, s: &str) { } } +#[cfg(target_os = "linux")] fn parse_kb_field(rest: &str) -> u64 { rest.split_whitespace() .next() @@ -2573,6 +2596,7 @@ mod tests { assert!(!line.contains("residency creates="), "{line}"); } + #[cfg(target_os = "linux")] #[test] fn fill_rss_from_status_and_smaps_edges() { let mut r = ProcRss::default(); From 7115d1c3e1c752b1b91ac85cd1f02569d7cd7845 Mon Sep 17 00:00:00 2001 From: xstoicunicornx Date: Tue, 22 Sep 2026 21:10:58 +0000 Subject: [PATCH 3/3] net: rename read_proc_rss and ProcRss off the /proc name Proc named the Linux /proc filesystem, the wrong association now that only one of three arms goes near it. read_proc_rss becomes read_platform_rss across the two re-exports and the rbitcoin-node caller; ProcRss becomes ProcessRss. The reader takes the platform name because its mechanism really does differ per target. The struct does not: it is the same five numbers everywhere and only the count of filled fields varies, so it is named for what it holds. The wrapper that forwarded to the per-target function is gone; each arm is now the public fn itself, and its rustdoc covers only that target, since a reader on Darwin has no use for the smaps_rollup fallback. The contract they share, which fields a target can fill and that a zero often means unmeasurable rather than empty, moves to ProcessRss. --- crates/rbitcoin-net/src/ibd/mod.rs | 4 +- crates/rbitcoin-net/src/ibd/perf_log.rs | 90 +++++++++++++------------ crates/rbitcoin-net/src/lib.rs | 4 +- crates/rbitcoin-node/src/run.rs | 4 +- 4 files changed, 52 insertions(+), 50 deletions(-) diff --git a/crates/rbitcoin-net/src/ibd/mod.rs b/crates/rbitcoin-net/src/ibd/mod.rs index de6afe45b..666e96a3a 100644 --- a/crates/rbitcoin-net/src/ibd/mod.rs +++ b/crates/rbitcoin-net/src/ibd/mod.rs @@ -32,7 +32,7 @@ mod state; mod status; pub use dial::connect_timeout_for; -pub use perf_log::{format_tip_perf_sizes, read_proc_rss, ProcRss, TipPerfSizes}; +pub use perf_log::{format_tip_perf_sizes, read_platform_rss, ProcessRss, TipPerfSizes}; use archive::{rehydrate_block_queue_into_confirm, rehydrate_class_a_into_body_queue}; use assign_plan::want_headers_beyond_soft_cap; @@ -829,7 +829,7 @@ pub async fn ibd_cancellable( conf_pipe.feed_inflight = feed_inflight; let work_sizes = st.structure_sizes(); let owned_sizes = hub.query.process_owned_size_snapshot(); - let rss = perf_log::read_proc_rss(); + let rss = perf_log::read_platform_rss(); let perf = perf_log::sample( &loop_stats, st.inflight.len(), diff --git a/crates/rbitcoin-net/src/ibd/perf_log.rs b/crates/rbitcoin-net/src/ibd/perf_log.rs index 7abd60f02..a103c8fe6 100644 --- a/crates/rbitcoin-net/src/ibd/perf_log.rs +++ b/crates/rbitcoin-net/src/ibd/perf_log.rs @@ -666,8 +666,13 @@ impl Default for IbdPerfSample { /// - `anon_kb` — process-private anonymous (heap, stacks, MAP_ANON) /// - `file_kb` — file-backed resident (shared libs + **our table mmaps**) /// - `locked_kb` — `mlock`/`mlockall` only (usually 0 for us) +/// +/// Which fields `read_platform_rss` can fill depends on the target: Linux +/// answers all of them, Darwin only `rss_kb`, other targets none. A zero is +/// therefore "not measurable here" as often as it is a real zero — see the +/// `read_platform_rss` arm for the target you are reading. #[derive(Clone, Copy, Debug, Default)] -pub struct ProcRss { +pub struct ProcessRss { pub rss_kb: u64, pub anon_kb: u64, pub file_kb: u64, @@ -678,31 +683,13 @@ pub struct ProcRss { /// Cheap once-per-tick resident-size read (not hot path). /// -/// One platform arm compiles at a time: Linux reads `/proc`, Darwin asks -/// `proc_pid_rusage`, anything else (Windows) has neither and reports zeros. -/// Gating beats letting a missing `/proc` fail at runtime — it keeps non-Linux -/// hosts from two doomed `open` calls on every 5s sample. -/// -/// Linux prefers `/proc/self/status` fields present on modern kernels -/// (`RssAnon` / `RssFile` / `VmRSS`), falling back to `smaps_rollup` -/// (`Anonymous:`, `Rss:`, `Locked:`) when the status split is missing — older -/// rollups do **not** expose `RssAnon:` / `RssFile:` (that bug made -/// `ibd: sizes` print `anon=0 file=0`). -/// -/// Darwin gets `rss` only. That flavor carries no anon/file resident split and -/// no resident peak, so `anon` / `file` / `hwm` / `locked` stay zero there: the -/// `ibd: sizes` `residual≈` heap cross-check (anon minus accounted) and the -/// `hwm=` peak are Linux-only. Darwin's only lifetime peak is over -/// `phys_footprint`, which excludes clean file-backed pages and so can read -/// below a mapped-file RSS — a "peak" under the current value is worse than -/// none, so it is not wired to `hwm`. -pub fn read_proc_rss() -> ProcRss { - read_platform_rss() -} - +/// Reads `/proc/self/status` for the fields modern kernels expose (`VmRSS`, +/// `VmHWM`, `RssAnon`, `RssFile`), then `smaps_rollup` (`Rss:`, `Anonymous:`, +/// `Locked:`) to fill a missing split — older rollups do **not** expose +/// `RssAnon:` / `RssFile:` (that bug made `ibd: sizes` print `anon=0 file=0`). #[cfg(target_os = "linux")] -fn read_platform_rss() -> ProcRss { - let mut out = ProcRss::default(); +pub fn read_platform_rss() -> ProcessRss { + let mut out = ProcessRss::default(); if let Ok(s) = std::fs::read_to_string("/proc/self/status") { fill_rss_from_status(&mut out, &s); } @@ -712,20 +699,35 @@ fn read_platform_rss() -> ProcRss { out } +/// Cheap once-per-tick resident-size read (not hot path). +/// +/// Darwin has no `/proc`, so this asks `proc_pid_rusage`. That flavor gives +/// `rss` alone: no anon/file resident split and no resident peak, so `anon` / +/// `file` / `hwm` / `locked` stay zero and the `ibd: sizes` `residual≈` heap +/// cross-check (anon minus accounted) reads as `0` here rather than meaning +/// the heap matched. Darwin's only lifetime peak is over `phys_footprint`, +/// which excludes clean file-backed pages and so can read below a mapped-file +/// RSS — a "peak" under the current value is worse than none, so `hwm` is +/// left at zero instead. #[cfg(target_os = "macos")] -fn read_platform_rss() -> ProcRss { - let mut out = ProcRss::default(); +pub fn read_platform_rss() -> ProcessRss { + let mut out = ProcessRss::default(); fill_rss_from_rusage(&mut out); out } +/// Cheap once-per-tick resident-size read (not hot path). +/// +/// Windows has neither `/proc` nor `proc_pid_rusage`, and the `libc` we depend +/// on exposes no process-memory call there, so every field reads zero. Real +/// numbers would need `GetProcessMemoryInfo` (psapi) and a new dependency. #[cfg(not(any(target_os = "linux", target_os = "macos")))] -fn read_platform_rss() -> ProcRss { - ProcRss::default() +pub fn read_platform_rss() -> ProcessRss { + ProcessRss::default() } #[cfg(target_os = "macos")] -fn fill_rss_from_rusage(out: &mut ProcRss) { +fn fill_rss_from_rusage(out: &mut ProcessRss) { let mut info: libc::rusage_info_v0 = unsafe { std::mem::zeroed() }; // SAFETY: RUSAGE_INFO_V0 selects the `rusage_info_v0` layout being written // here; an unsupported flavor returns non-zero without touching `info`. @@ -742,7 +744,7 @@ fn fill_rss_from_rusage(out: &mut ProcRss) { } #[cfg(target_os = "linux")] -fn fill_rss_from_status(out: &mut ProcRss, s: &str) { +fn fill_rss_from_status(out: &mut ProcessRss, s: &str) { for line in s.lines() { if let Some(rest) = line.strip_prefix("VmRSS:") { out.rss_kb = parse_kb_field(rest); @@ -762,7 +764,7 @@ fn fill_rss_from_status(out: &mut ProcRss, s: &str) { } #[cfg(target_os = "linux")] -fn fill_rss_from_smaps_rollup(out: &mut ProcRss, s: &str) { +fn fill_rss_from_smaps_rollup(out: &mut ProcessRss, s: &str) { for line in s.lines() { if let Some(rest) = line.strip_prefix("Rss:") { if out.rss_kb == 0 { @@ -804,7 +806,7 @@ fn kb_mib(kb: u64) -> u64 { /// Occupancy + RSS for the tip-follow 5s DEBUG `tip: perf` line. #[derive(Clone, Copy, Debug, Default)] pub struct TipPerfSizes { - pub rss: ProcRss, + pub rss: ProcessRss, pub cache_bodies: usize, pub held_bodies: usize, pub sh_heads: usize, @@ -846,7 +848,7 @@ pub(crate) fn sample( work: WorkStructureSizes, owned: ProcessOwnedSizes, conf_pipe: ConfirmPipelineSizes, - rss: ProcRss, + rss: ProcessRss, stats: &rbitcoin_query::ConfirmStats, ) -> IbdPerfSample { let (bq_bytes, bq_count, bq_soft_stop) = bq; @@ -2403,7 +2405,7 @@ mod tests { let _ = rbitcoin_log::take_logs(); rbitcoin_log::capture_logs(false); rbitcoin_log::init(Level::Info); - let rss = read_proc_rss(); + let rss = read_platform_rss(); assert!(rss.rss_kb > 0 || cfg!(not(target_os = "linux"))); } @@ -2599,7 +2601,7 @@ mod tests { #[cfg(target_os = "linux")] #[test] fn fill_rss_from_status_and_smaps_edges() { - let mut r = ProcRss::default(); + let mut r = ProcessRss::default(); fill_rss_from_status( &mut r, "Name:\trbitcoin\nVmRSS:\t 1024 kB\nVmHWM:\t 2048 kB\nRssAnon:\t512 kB\nRssFile:\t256 kB\nRssShmem:\t128 kB\n", @@ -2609,7 +2611,7 @@ mod tests { assert_eq!(r.anon_kb, 512); assert_eq!(r.file_kb, 384); - let mut r = ProcRss::default(); + let mut r = ProcessRss::default(); fill_rss_from_smaps_rollup( &mut r, "Rss:\t 800 kB\nAnonymous:\t 300 kB\nRssAnon:\t 1 kB\nRssFile:\t 2 kB\nLocked:\t 16 kB\n", @@ -2619,7 +2621,7 @@ mod tests { assert_eq!(r.file_kb, 2); assert_eq!(r.locked_kb, 16); - let mut r = ProcRss::default(); + let mut r = ProcessRss::default(); fill_rss_from_smaps_rollup(&mut r, "Rss:\t 900 kB\nAnonymous:\t 400 kB\n"); assert_eq!(r.rss_kb, 900); assert_eq!(r.anon_kb, 400); @@ -2628,8 +2630,8 @@ mod tests { #[cfg(any(target_os = "linux", target_os = "macos"))] #[test] - fn read_proc_rss_reports_resident_size() { - let r = read_proc_rss(); + fn read_platform_rss_reports_resident_size() { + let r = read_platform_rss(); // Linux reads /proc/self/status; Darwin reads proc_pid_rusage. // A live test process is resident either way. assert!(r.rss_kb > 0, "expected a resident size, got {r:?}"); @@ -2637,8 +2639,8 @@ mod tests { #[cfg(target_os = "linux")] #[test] - fn read_proc_rss_splits_anon_and_file_on_linux() { - let r = read_proc_rss(); + fn read_platform_rss_splits_anon_and_file_on_linux() { + let r = read_platform_rss(); // VmHWM is a high-water mark, so it never trails current residency. assert!(r.hwm_kb >= r.rss_kb, "hwm should not trail rss, got {r:?}"); // Modern kernels expose RssAnon/RssFile on status; at least one side @@ -2669,7 +2671,7 @@ mod tests { let work = WorkStructureSizes::default(); let owned = ProcessOwnedSizes::default(); let conf_pipe = ConfirmPipelineSizes::default(); - let rss = read_proc_rss(); + let rss = read_platform_rss(); let s = sample( &loop_stats, 4, // inflight @@ -2733,7 +2735,7 @@ mod tests { #[test] fn format_tip_perf_sizes_tokens_and_mib() { let line = super::format_tip_perf_sizes(&super::TipPerfSizes { - rss: super::ProcRss { + rss: super::ProcessRss { rss_kb: 2 * 1024, anon_kb: 1024, file_kb: 512, diff --git a/crates/rbitcoin-net/src/lib.rs b/crates/rbitcoin-net/src/lib.rs index 583229b7a..72986db2d 100644 --- a/crates/rbitcoin-net/src/lib.rs +++ b/crates/rbitcoin-net/src/lib.rs @@ -40,8 +40,8 @@ pub use error::NetError; pub use eviction::{select_inbound_eviction, InboundEvictCandidate}; pub use i2p_sam::I2pSam; pub use ibd::{ - connect_timeout_for, format_tip_perf_sizes, read_proc_rss, rehydrate_block_queue_residue, - IbdConfig, ProcRss, TipPerfSizes, DEFAULT_BLOCKS_IN_TRANSIT_PER_PEER, DEFAULT_IBD_WINDOW, + connect_timeout_for, format_tip_perf_sizes, read_platform_rss, rehydrate_block_queue_residue, + IbdConfig, ProcessRss, TipPerfSizes, DEFAULT_BLOCKS_IN_TRANSIT_PER_PEER, DEFAULT_IBD_WINDOW, }; pub use most_work::sum_work; pub use net_permissions::{ diff --git a/crates/rbitcoin-node/src/run.rs b/crates/rbitcoin-node/src/run.rs index 060b55d8f..be228a217 100644 --- a/crates/rbitcoin-node/src/run.rs +++ b/crates/rbitcoin-node/src/run.rs @@ -6,7 +6,7 @@ use rbitcoin_electrum::{run_electrum, ElectrumConfig, ElectrumHandle, TipNotify} use rbitcoin_esplora::{run_esplora, BlockTemplateFn, EsploraConfig, EsploraHandle, EsploraListen}; use rbitcoin_log::{debug, enabled, info, warn, Level}; use rbitcoin_net::{ - default_port, format_serve_perf, format_tip_perf_sizes, netgroup, read_proc_rss, + default_port, format_serve_perf, format_tip_perf_sizes, netgroup, read_platform_rss, sample_reset_serve_perf, socks_dns_seed_dests, AddrMan, AsMap, BlockingRegion, ChainHub, Dialer, IbdConfig, MempoolHub, P2PNode, PeerConnType, TipEvent, TipPerfSizes, }; @@ -929,7 +929,7 @@ pub async fn run_p2p(config: NodeConfig) -> Result<(), NodeError> { let el_avg = el_us.checked_div(el_n).unwrap_or(0); let serve_s = format_serve_perf(&serve); let sizes = format_tip_perf_sizes(&TipPerfSizes { - rss: read_proc_rss(), + rss: read_platform_rss(), cache_bodies: node.hub.cache_body_count(), held_bodies: node.hub.held_body_count(), sh_heads: node.query.process_owned_size_snapshot().sh_heads,