mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 02:08:02 +00:00
Remove incorrect proof about Jemalloc (#3982)
* Remove incorrect proof about Jemalloc The truth is that Jemalloc is not always the default allocator. This is only true for the polkadot binary. * Fmt * Rephrase
This commit is contained in:
@@ -518,18 +518,36 @@ where
|
|||||||
}
|
}
|
||||||
let subsystem_meters = overseer.map_subsystems(ExtractNameAndMeters);
|
let subsystem_meters = overseer.map_subsystems(ExtractNameAndMeters);
|
||||||
|
|
||||||
let memory_stats =
|
let collect_memory_stats: Box<dyn Fn(&OverseerMetrics) + Send> =
|
||||||
MemoryAllocationTracker::new().expect("Jemalloc is the default allocator. qed");
|
match MemoryAllocationTracker::new() {
|
||||||
|
Ok(memory_stats) =>
|
||||||
|
Box::new(move |metrics: &OverseerMetrics| match memory_stats.snapshot() {
|
||||||
|
Ok(memory_stats_snapshot) => {
|
||||||
|
tracing::trace!(
|
||||||
|
target: LOG_TARGET,
|
||||||
|
"memory_stats: {:?}",
|
||||||
|
&memory_stats_snapshot
|
||||||
|
);
|
||||||
|
metrics.memory_stats_snapshot(memory_stats_snapshot);
|
||||||
|
},
|
||||||
|
Err(e) => tracing::debug!(
|
||||||
|
target: LOG_TARGET,
|
||||||
|
"Failed to obtain memory stats: {:?}",
|
||||||
|
e
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
Err(_) => {
|
||||||
|
tracing::debug!(
|
||||||
|
target: LOG_TARGET,
|
||||||
|
"Memory allocation tracking is not supported by the allocator.",
|
||||||
|
);
|
||||||
|
|
||||||
|
Box::new(|_| {})
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
let metronome = Metronome::new(std::time::Duration::from_millis(950)).for_each(move |_| {
|
let metronome = Metronome::new(std::time::Duration::from_millis(950)).for_each(move |_| {
|
||||||
match memory_stats.snapshot() {
|
collect_memory_stats(&metronome_metrics);
|
||||||
Ok(memory_stats_snapshot) => {
|
|
||||||
tracing::trace!(target: LOG_TARGET, "memory_stats: {:?}", &memory_stats_snapshot);
|
|
||||||
metronome_metrics.memory_stats_snapshot(memory_stats_snapshot);
|
|
||||||
},
|
|
||||||
|
|
||||||
Err(e) => tracing::debug!(target: LOG_TARGET, "Failed to obtain memory stats: {:?}", e),
|
|
||||||
}
|
|
||||||
|
|
||||||
// We combine the amount of messages from subsystems to the overseer
|
// We combine the amount of messages from subsystems to the overseer
|
||||||
// as well as the amount of messages from external sources to the overseer
|
// as well as the amount of messages from external sources to the overseer
|
||||||
|
|||||||
Reference in New Issue
Block a user