I am new to RUST as well as for programming. I just wrote LED blinking program on raspberry pi 3 using RUST language. It worked well. My debug binary file size is 4.7MB. Its really huge. So I released the file and it got reduced to 2.5MB. I found that due to default operation of Jemalloc, Debug symbol and Panic Rust executables are very large. Can somebody help me out how much memory is consumed by Jemalloc, Debug Symbol and Panic? How to find this ? where it is located? How can I remove or deallocate Jemalloc?
I am working with Rust 1.38.0 stable version on Raspberry pi 3 using Visual studio code IDE.
main.rs file
use rust_gpiozero::*;
use std::thread;
use std::time::Duration;
fn main() {
//create a new LEd attached to pin 17
let led = LED::new(17);
//blink the led 5 times
for _ in 0.. 5{
led.on();
thread::sleep(Duration::from_secs(10));
led.off();
thread::sleep(Duration::from_secs(10));
}
}
cargo.toml file
[package]
name = "led_blink"
version = "0.1.0"
authors = ["pi"]
edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
libc = "0.2"
rust_gpiozero = "0.2.0"
[profile.release]
codegen-units = 1
I want to know about how much memory consumed by jemalloc, debug symbol and panic in total size. and how to remove/Deactivate all three operation by default. Looking for help, Thank you