Answer the question
In order to leave comments, you need to log in
Why is the minimum app size so big?
I'm trying to compile "dummy":
fn main() {
}
Answer the question
In order to leave comments, you need to log in
A hackneyed topic that has already been raised and studied more than once. It is enough to do: https://www.google.com/search?q=rust+binary+size and immediately get to the Rustlog article: Why is a Rust executable large? . A highly recommended read, even though it's a little outdated (Rust no longer uses jemalloc by default), it's covered in great detail.
In short, then your binary gets:
1. If it was not collected in release mode, then debug symbols.
2. Allocator, or code-glue for the system allocator.
3. Code for panic unwinding (including libbacktrace).
4. Parts of Rust's libstd, even if you don't use them.
If the task is to minimize the Rust binary (for any embedded, for example), then they usually do it #![no_std]
, use mini-allocators , do it panic = abort
and go to other hardships.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question