pub fn start_flush_thread(port: u16)Expand description
Starts the background flush thread that streams allocation events to the analyzer.
Must be called once at program startup, before allocations of interest occur.
The analyzer must be listening on 127.0.0.1:<port> (default: 7777).
Examples found in repository?
examples/basic.rs (line 8)
6fn main() {
7 // Connect to the analyzer before any tracked work begins
8 start_flush_thread(7777);
9
10 println!("Allocating some data...");
11
12 let v: Vec<u8> = vec![0u8; 1024 * 1024]; // 1 MB
13 println!("Allocated {} bytes", v.len());
14
15 let s = String::from("ferroalloc probe example");
16 println!("String: {s}");
17
18 // v and s are dropped here — dealloc events are emitted automatically
19 println!("Done. Check the analyzer for allocation data.");
20}