Skip to content

<Future as std::..::Future>::poll() always allocates, growing until we're woken #2874

Closed

Description

@TheBlueMatt

<Future as std::..::Future>::poll(), if state.complete is not set, always pushes the provided waker onto the callbacks vec. This means if we get poll'd regularly our memory will grow and grow until we get woken, which may be quite a while. Thus, this may end up using a very nontrivial amount of memory, at least on busy nodes.

Activity

  1. added this to the 0.0.122 milestone on Feb 5, 2024
  2. nate-lightspark commented on Feb 6, 2024

    @nate-lightspark

    To add more color to the issue, carrying notes from the Discord thread:

    Looking at the memory profiler run with dhat leads to the result in the screenshot. The hot piece looks to be chain_monitor.get_update_future() :

    Profiler Result 1

    Profiler After

    It is an adapted from this example code

    The code block is like this for the severe memory leak: Gist 1

    Change is like this, seems to be resolving the issue (or makes it less severe): Gist 2

  3. added 3 commits that reference this issue on Feb 13, 2024
    60bff36
    8dd78dd
    8157c01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions