8000 Keys occupy double memory size after updating · Issue #473 · moka-rs/moka · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Keys occupy double memory size after updating #473
Open
@zhu-he

Description

@zhu-he

Running the following code will use 2GB of memory.

let cache = moka::future::Cache::new(10);
cache.insert(vec![1u8; 1 << 30], ()).await;
cache.insert(vec![1u8; 1 << 30], ()).await;

Testable:

let cache = moka::future::Cache::new(10);
let key = std::sync::Arc::new(());
cache.insert(key.clone(), ()).await;
cache.insert(key.clone(), ()).await;
assert_eq!(std::sync::Arc::strong_count(&key), 2);

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0