Skip to content

ByteStream upload reads the whole blob into memory before sending #1565

Open

Description

@vlad-ivanov-name

upload_impl in remote_execution/oss/re_grpc/src/client.rs reads a blob into a Vec<WriteRequest> of all segments and only then calls ByteStream.Write with futures::stream::iter(segments). The memory used by one upload is the size of the blob. A 2 GiB file uploaded with --upload-all-actions or as a cache upload costs 2 GiB of heap.

The segments can be produced lazily and passed to write as a stream, so only the segment in flight and one read ahead are in memory.

https://github.com/facebook/buck2/blob/8c4e27d602/remote_execution/oss/re_grpc/src/client.rs#L1645-L1683

Activity

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

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions