We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem
Removing X elements and adding them back should maintain the same memory usage, instead it always increases
Steps To Reproduce
Run this modified example: https://github.com/marc2332/dioxus/blob/memory-leak/packages/native-core/examples/memory-leak.rs
Expected behavior
Memory should not increase if the DOM size is the same.
Screenshots
Environment:
master
The text was updated successfully, but these errors were encountered:
This code leaks memory with just core:
#![allow(non_snake_case)] use dioxus::prelude::*; use std::sync::atomic::AtomicUsize; fn main() { fn app(cx: Scope) -> Element { Some({ let __cx = cx; static TEMPLATE: ::dioxus::core::Template = ::dioxus::core::Template { name: "examples/readme.rs:14:9:432", roots: &[::dioxus::core::TemplateNode::Dynamic { id: 0usize }], node_paths: &[&[0u8]], attr_paths: &[], }; ::dioxus::core::VNode { parent: None, key: None, template: std::cell::Cell::new(TEMPLATE), root_ids: Default::default(), dynamic_nodes: __cx.bump().alloc([__cx.make_node("Testing")]), dynamic_attrs: __cx.bump().alloc([]), } }) } let mut vdom = VirtualDom::new(app); let _ = vdom.rebuild(); loop { // get the mutations from the vdom { let mutations = vdom.render_immediate(); println!("Mutations: {:#?}", mutations); } vdom.mark_dirty(ScopeId(0)); println!("{vdom:#?}"); } }
Sorry, something went wrong.
Successfully merging a pull request may close this issue.
Problem
Removing X elements and adding them back should maintain the same memory usage, instead it always increases
Steps To Reproduce
Run this modified example: https://github.com/marc2332/dioxus/blob/memory-leak/packages/native-core/examples/memory-leak.rs
Expected behavior
Memory should not increase if the DOM size is the same.
Screenshots
NVIDIA_Share_zAt6ThMzOj.mp4
Environment:
master
The text was updated successfully, but these errors were encountered: