WARNING: THIS SITE IS A MIRROR OF GITHUB.COM / IT CANNOT LOGIN OR REGISTER ACCOUNTS / THE CONTENTS ARE PROVIDED AS-IS / THIS SITE ASSUMES NO RESPONSIBILITY FOR ANY DISPLAYED CONTENT OR LINKS / IF YOU FOUND SOMETHING MAY NOT GOOD FOR EVERYONE, CONTACT ADMIN AT ilovescratch@foxmail.com
Skip to content

fix(util/cache): BlobMemoryCache reserving more memory than actual #483

@sambhav-jain-16

Description

@sambhav-jain-16

Describe the bug
Currently, if a caller adds a *MemoryEntry with Data being set to a slice s with len(s) < cap(s), this will cause our mem cache to use more memory than its capacity leading to the mem cache using more memory than it thinks it reserves. This means that caller mistakes could lead to OOM errors.

To Reproduce
Reserve less capacity from blob memory cache but set the data with more size than the reserve capacity.

Expected behavior
BlobMemoryCache should handle caller mistakes in case of these buffer size mismatches.

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