Skip to content
New issue

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

Clean-up runtimes management in runtime_service #2781

Merged
merged 3 commits into from
Sep 28, 2022

Conversation

tomaka
Copy link
Contributor

@tomaka tomaka commented Sep 26, 2022

Fix #2467

We now clean up old runtimes when it makes sense, rather than after a download where it doesn't make sense.

Copy link
Contributor

@mergify mergify bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Automatically approving tomaka's pull requests. This auto-approval will be removed once more maintainers are active.

Comment on lines -1968 to +1978
.retain(|_, runtime| runtime.strong_count() == 0);
.retain(|_, runtime| runtime.strong_count() > 0);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the main bug behind #2467

@github-actions
Copy link
Contributor

github-actions bot commented Sep 26, 2022

twiggy diff report

Difference in .wasm size before and after this pull request.


 Delta Bytes │ Item
─────────────┼─────────────────────────────────────────────────────────────────────────────────────────────────────────────────
        -682 ┊ <slab::Slab<T> as core::iter::traits::collect::FromIterator<(usize,T)>>::from_iter::h05085178e898dc6e
        +682 ┊ <slab::Slab<T> as core::iter::traits::collect::FromIterator<(usize,T)>>::from_iter::h5e213dc6691e074f
        +417 ┊ core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once::h0094c084a347f4ca
        -417 ┊ core::ops::function::impls::<impl core::ops::function::FnOnce<A> for &mut F>::call_once::hee2698b57d200a4c
        +293 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h17704046b04e9b9c
        -293 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h41448ea2b94498d1
        +293 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h6faaf639621b42ae
        -293 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::h82df4da3915cf2d3
        -293 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::ha10589a8b47bc38d
        +293 ┊ <alloc::vec::Vec<T> as alloc::vec::spec_from_iter_nested::SpecFromIterNested<T,I>>::from_iter::hb506c76ad1abe76a
        +200 ┊ smoldot::chain::async_tree::AsyncTree<TNow,TBl,TAsync>::map_async_op_user_data::h433803251b98303c
        -200 ┊ smoldot::chain::async_tree::AsyncTree<TNow,TBl,TAsync>::map_async_op_user_data::hbe00395cc4b9afe0
        -184 ┊ alloc::vec::Vec<T,A>::extend_desugared::h398c45e2da060f39
        +184 ┊ alloc::vec::Vec<T,A>::extend_desugared::h60ef2608e6fbcd55
        -184 ┊ alloc::vec::Vec<T,A>::extend_desugared::h9204ec0bf66040f4
        -184 ┊ alloc::vec::Vec<T,A>::extend_desugared::h9e03642c1ae124f7
        +184 ┊ alloc::vec::Vec<T,A>::extend_desugared::ha0437ef903ee859c
        +184 ┊ alloc::vec::Vec<T,A>::extend_desugared::he3cce62a76f46275
        +154 ┊ slab::Slab<T>::retain::hc5d9eb9a250dc2b3
        -154 ┊ slab::Slab<T>::retain::hcdf5a293f6155417
          -1 ┊ ... and 31 more.
          -1 ┊ Σ [51 Total Rows]

Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@tomaka tomaka added the automerge Automatically merge pull request as soon as possible label Sep 28, 2022
@mergify mergify bot merged commit ef43d84 into paritytech:main Sep 28, 2022
@tomaka tomaka deleted the rt-service-cleanup branch September 28, 2022 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge Automatically merge pull request as soon as possible
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Memory isn't freed after a runtime upgrade
2 participants