Skip to content

gnovm store: SetCachePackage stores packages on memory. Possible OOM errors. #812

@ajnavarro

Description

@ajnavarro

Description

After trying to reduce the memory usage moving from maps to an LRU cache here (#780), I realized that packages set on cacheObjects are not expected to be evicted, causing problems if we use an LRU cache.

Possible Solution

We can store these packages on persistent storage using a special key like /tmp/[UUID]/oid:[OID] where [UUID] is a unique ID created per storage session (every time you initialise a store or purge it)

When purging cache calling ClearObjectCache we generate a new UUID and we remove all keys under the previous UUID /tmp/[UUID]

On every server restart, we remove all keys under /tmp

WDYT?

Metadata

Metadata

Assignees

No one assigned

    Labels

    📦 🤖 gnovmIssues or PRs gnovm related🌟 improvementperformance improvements, refactors ...

    Type

    No type

    Projects

    Status

    Need lots of help

    Status

    Backlog

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions