Skip to content

Reduce async state and static pool memory in simple_someip to prevent Embassy arena exhaustion #125

Description

@FelicianoAngulo2

Summary

Arena pressure is dominated by simple_someip async/stateful paths, not by integration wrapper code.
The goal is to reduce retained async state across await points and trim oversized static pools.
Observed simple_someip hotspots (from linked symbols / type-size output)

Async/task state growth:

simple_someip::client::socket_manager::SocketManager::socket_loop_future
simple_someip::client::inner::Inner::handle_control_message
simple_someip::client::inner::Inner::unbind_discovery
simple_someip::server::runtime::recv_loop
simple_someip::server::runtime::announce_loop
simple_someip::server::runtime::send_subscribe_nack_from_view

Pool/static memory growth:

simple_someip::static_channels::MpscPool<SendMessage, ...>::release
simple_someip::static_channels::MpscPool<Result<ReceivedMessage, Error>, ...>::release
simple_someip::static_channels::MpscPool<ClientUpdate, ...>
simple_someip::static_channels::OneshotPool<Result<client::error::Error, ...>, ...>
simple_someip::transport::BoundedPooled / OneshotPooled channel pairs

Encoding paths contributing to monomorphization/code+state pressure:

simple_someip::protocol::sd::header::Header::encode
simple_someip::protocol::sd::entry::ServiceEntry::encode
simple_someip::protocol::sd::entry::EventGroupEntry::encode

Problem

Large futures keep too much state alive across await boundaries.
Channel/pool capacities appear overprovisioned, increasing static RAM footprint and allocator pressure in no_std pooled paths.
Result: fragile arena sizing and runtime failures when feature growth slightly increases task state.

Acceptance criteria

Measurable reduction in top TaskStorage entries for simple_someip tasks (before/after table in PR).
Measurable reduction in largest static pool symbols (before/after nm size table).
No functional regressions in existing simple_someip tests.

Repro / measurement commands (simple_someip only)

cargo clean && cargo rustc --release -- -Z print-type-sizes 2>&1 | grep -i TaskStorage
llvm-nm --print-size --size-sort <elf_or_archive> | grep -Ei "simple_someip|MpscPool|OneshotPool|BoundedPooled|TaskStorage"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

simple_someipIssue related to the simple_someip crate

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions