slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
17.09k stars 575 forks source link

rust slint dekstop app on raspberry pi 4 with 2GB RAM cargo run taking more than 1.8GB RAM #4924

Closed learncodingforweb closed 3 weeks ago

learncodingforweb commented 6 months ago

slint desktop app run using rCargo run on raspberry pi 4 with 2GB RAM taking more than 1.8GB. which causes complete hang out raspberry pi 4. unable to do any thing until i do force shutdown. i am not able to run slint desktop app on rapsberry pi?

ogoffart commented 6 months ago

What rendering backend are you using?

Could you run the app with a memory profiler such as heaptrack (or valgrind's massif) to see what is taking the most memory?

learncodingforweb commented 6 months ago

getting lots memory leak error

/usr/lib/heaptrack/libheaptrack_preload.so
starting application, this might take some time...
heaptrack stats:
    allocations:            221098
    leaked allocations:     3369
    temporary allocations:  71491
alloc::raw_vec::finish_grow::h069a4a4254ec0534 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve::do_reserve_and_handle::h076ca411e099ffc4 in cargo
<unresolved function> in cargo
core::fmt::rt::Argument::fmt::h76c38a80d925a410 in cargo
core::fmt::write::h3ed6aeaa977c8e45 in cargo
_$LT$rustup..dist..dist..ToolchainDesc$u20$as$u20$core..fmt..Display$GT$::fmt::h049e8fe652f811d0 in cargo
core::fmt::rt::Argument::fmt::h76c38a80d925a410 in cargo
core::fmt::write::h3ed6aeaa977c8e45 in cargo
_$LT$T$u20$as$u20$alloc..string..ToString$GT$::to_string::h44c6de4036b9a07b in cargo
rustup::config::Cfg::toolchain_path::h10228d98d69dcb97 in cargo
rustup::toolchain::toolchain::Toolchain::new::h75cafa9b2d95d32a in cargo
rustup::toolchain::distributable::DistributableToolchain::new::hf673885175298b43 in cargo
rustup::config::Cfg::find_or_install_override_toolchain_or_default::hf53a2eb9a1e6cbfc in cargo
rustup::cli::proxy_mode::main::hb20b8cc3420a9113 in cargo
rustup_init::main::h0752cd18621874a4 in cargo
std::sys_common::backtrace::__rust_begin_short_backtrace::h7dc946ad4bdc98a9 in cargo
main in cargo
alloc::raw_vec::finish_grow::h069a4a4254ec0534 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve::do_reserve_and_handle::h30f333b426a7a3d7 in cargo
regex_automata::meta::strategy::new::heb4b520f7cf578aa in cargo
regex_automata::meta::regex::Builder::build::h17d060d05018986a in cargo
regex::regex::string::Regex::new::h2e38cf93fafee8a7 in cargo
core::ops::function::FnOnce::call_once::h29841741b4433fc4 in cargo
once_cell::imp::OnceCell$LT$T$GT$::initialize::_$u7b$$u7b$closure$u7d$$u7d$::hf143148fbf69dbd7 in cargo
once_cell::imp::initialize_or_wait::hadd0f205ded9a13e in cargo
once_cell::imp::OnceCell$LT$T$GT$::initialize::hf0ab78fe50e8fba4 in cargo
_$LT$rustup..dist..dist..ParsedToolchainDesc$u20$as$u20$core..str..traits..FromStr$GT$::from_str::he4ee4ee4566def78 in cargo
_$LT$rustup..dist..dist..PartialToolchainDesc$u20$as$u20$core..str..traits..FromStr$GT$::from_str::h69919dbeb3e873db in cargo
rustup::toolchain::names::ResolvableToolchainName::validate::ha8480f7f83c8ec03 in cargo
rustup::cli::common::set_globals::hf817933ccf406831 in cargo
rustup::cli::proxy_mode::main::hb20b8cc3420a9113 in cargo
rustup_init::main::h0752cd18621874a4 in cargo
std::sys_common::backtrace::__rust_begin_short_backtrace::h7dc946ad4bdc98a9 in cargo
main in cargo
std::sys::unix::alloc::_$LT$impl$u20$core..alloc..global..GlobalAlloc$u20$for$u20$std..alloc..System$GT$::realloc::h1f843bb9bb0de1c3 in cargo
__rdl_realloc in cargo
alloc::alloc::realloc::h736cdde27175cb6f in cargo
_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::shrink::hee98ff2151312322 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::shrink::h11b983d41337f465 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::shrink_to_fit::hedb61f0d4f7df682 in cargo
alloc::vec::Vec$LT$T$C$A$GT$::shrink_to_fit::h69b8ef722b488d73 in cargo
std::sys::unix::os::getcwd::h5debd690235afedc in cargo
std::env::current_dir::h4f8d7f94c3d4229d in cargo
rustup_init::main::h0752cd18621874a4 in cargo
std::sys_common::backtrace::__rust_begin_short_backtrace::h7dc946ad4bdc98a9 in cargo
main in cargo
std::sys::unix::alloc::_$LT$impl$u20$core..alloc..global..GlobalAlloc$u20$for$u20$std..alloc..System$GT$::realloc::h1f843bb9bb0de1c3 in cargo
__rdl_realloc in cargo
alloc::alloc::realloc::h736cdde27175cb6f in cargo
_$LT$alloc..alloc..Global$u20$as$u20$core..alloc..Allocator$GT$::shrink::hee98ff2151312322 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::shrink::h11b983d41337f465 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::shrink_to_fit::hedb61f0d4f7df682 in cargo
alloc::vec::Vec$LT$T$C$A$GT$::shrink_to_fit::h69b8ef722b488d73 in cargo
std::sys::unix::os::getcwd::h5debd690235afedc in cargo
std::env::current_dir::h4f8d7f94c3d4229d in cargo
rustup_init::main::h0752cd18621874a4 in cargo
std::sys_common::backtrace::__rust_begin_short_backtrace::h7dc946ad4bdc98a9 in cargo
main in cargo
OPENSSL_LH_insert in cargo
OBJ_NAME_add in cargo
openssl_add_all_ciphers_int in cargo
ossl_init_add_all_ciphers_ossl_ in cargo
__pthread_once_slow in libc.so.6
CRYPTO_THREAD_run_once in cargo
OPENSSL_init_crypto in cargo
OPENSSL_init_ssl in cargo
ossl_init in cargo
curl_global_init in cargo
std::sys_common::once::futex::Once::call::hd3e43fe3fc734a00 in cargo
curl::INIT_CTOR::init_ctor::h8d2e7f609ea646a7 in cargo
__libc_csu_init in cargo
__libc_start_main_impl in libc.so.6
<unresolved function> in cargo

alloc::raw_vec::finish_grow::h069a4a4254ec0534 in cargo alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve::do_reserve_and_handle::h3b69ee444ef8f4e0 in cargo regex_automata::nfa::thompson::compiler::Compiler::compile::h524f1833e9f114bf in cargo regex_automata::meta::strategy::new::heb4b520f7cf578aa in cargo regex_automata::meta::regex::Builder::build::h17d060d05018986a in cargo regex::regex::string::Regex::new::h2e38cf93fafee8a7 in cargo core::ops::function::FnOnce::call_once::h29841741b4433fc4 in cargo oncecell::imp::OnceCell$LT$T$GT$::initialize::$u7b$$u7b$closure$u7d$$u7d$::hf143148fbf69dbd7 in cargo once_cell::imp::initialize_or_wait::hadd0f205ded9a13e in cargo oncecell::imp::OnceCell$LT$T$GT$::initialize::hf0ab78fe50e8fba4 in cargo $LT$rustup..dist..dist..ParsedToolchainDesc$u20$as$u20$core..str..traits..FromStr$GT$::fromstr::he4ee4ee4566def78 in cargo $LT$rustup..dist..dist..PartialToolchainDesc$u20$as$u20$core..str..traits..FromStr$GT$::from_str::h69919dbeb3e873db in cargo rustup::toolchain::names::ResolvableToolchainName::validate::ha8480f7f83c8ec03 in cargo rustup::cli::common::set_globals::hf817933ccf406831 in cargo rustup::cli::proxy_mode::main::hb20b8cc3420a9113 in cargo rustup_init::main::h0752cd18621874a4 in cargo std::sys_common::backtrace::__rust_begin_short_backtrace::h7dc946ad4bdc98a9 in cargo main in cargo


```alloc::raw_vec::finish_grow::h069a4a4254ec0534 in cargo
alloc::raw_vec::RawVec$LT$T$C$A$GT$::reserve_for_push::h02b0456df51cd5fc in cargo
regex_syntax::hir::translate::TranslatorI::push::hb96777c02f49e925 in cargo
regex_automata::meta::regex::Builder::build::h17d060d05018986a in cargo
regex::regex::string::Regex::new::h2e38cf93fafee8a7 in cargo
core::ops::function::FnOnce::call_once::h29841741b4433fc4 in cargo
once_cell::imp::OnceCell$LT$T$GT$::initialize::_$u7b$$u7b$closure$u7d$$u7d$::hf143148fbf69dbd7 in cargo
once_cell::imp::initialize_or_wait::hadd0f205ded9a13e in cargo
once_cell::imp::OnceCell$LT$T$GT$::initialize::hf0ab78fe50e8fba4 in cargo
_$LT$rustup..dist..dist..ParsedToolchainDesc$u20$as$u20$core..str..traits..FromStr$GT$::from_str::he4ee4ee4566def78 in cargo
_$LT$rustup..dist..dist..PartialToolchainDesc$u20$as$u20$core..str..traits..FromStr$GT$::from_str::h69919dbeb3e873db in cargo
rustup::toolchain::names::ResolvableToolchainName::validate::ha8480f7f83c8ec03 in cargo
rustup::cli::common::set_globals::hf817933ccf406831 in cargo
rustup::cli::proxy_mode::main::hb20b8cc3420a9113 in cargo
rustup_init::main::h0752cd18621874a4 in cargo
std::sys_common::backtrace::__rust_begin_short_backtrace::h7dc946ad4bdc98a9 in cargo
main in cargo
MohaBeacon commented 6 months ago

i have a suggestion try turning off wayland and work with x11 instead - it might be the reason for the errors

ogoffart commented 6 months ago

@learncodingforweb I think you''ve been running the memory profiler on cargo or rust instead of running it on your application binary.

ogoffart commented 3 weeks ago

Closing this as this is not actionable. We aim to use as little memory as possible and in general we don't use so much memory, but this might be caused by something specific in your program.