This cache is never evicted. For large restores with many blobs (each up to 10GB per config), this will exhaust memory. Should implement an LRU cache with a configurable size limit, or write cached blobs to temp files.
In `restore.go` `Restore()`, downloaded+decrypted blobs are cached in memory:
```go
blobCache := make(map[string][]byte)
...
blobCache[blobHashStr] = blobData
```
This cache is never evicted. For large restores with many blobs (each up to 10GB per config), this will exhaust memory. Should implement an LRU cache with a configurable size limit, or write cached blobs to temp files.
Ref: parent issue #1
This issue is already resolved on main. The unbounded in-memory map[string][]byte blob cache was replaced with a disk-backed LRU cache (blobDiskCache in internal/vaultik/blobcache.go) via PR #34, which closed duplicate issue #29.
The implementation:
Writes cached blobs to a temp directory instead of holding them in memory
Tracks total cached bytes with LRU eviction when the limit is exceeded
Cache max is set to 4 × BlobSizeLimit (configurable via config)
This issue is already resolved on `main`. The unbounded in-memory `map[string][]byte` blob cache was replaced with a disk-backed LRU cache (`blobDiskCache` in `internal/vaultik/blobcache.go`) via [PR #34](https://git.eeqj.de/sneak/vaultik/pulls/34), which closed duplicate [issue #29](https://git.eeqj.de/sneak/vaultik/issues/29).
The implementation:
- Writes cached blobs to a temp directory instead of holding them in memory
- Tracks total cached bytes with LRU eviction when the limit is exceeded
- Cache max is set to `4 × BlobSizeLimit` (configurable via config)
- Entries larger than `maxBytes` are silently skipped
- Has comprehensive unit tests in `blobcache_test.go`
Closing as duplicate of [#29](https://git.eeqj.de/sneak/vaultik/issues/29).
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
In
restore.goRestore(), downloaded+decrypted blobs are cached in memory:This cache is never evicted. For large restores with many blobs (each up to 10GB per config), this will exhaust memory. Should implement an LRU cache with a configurable size limit, or write cached blobs to temp files.
Ref: parent issue #1
This issue is already resolved on
main. The unbounded in-memorymap[string][]byteblob cache was replaced with a disk-backed LRU cache (blobDiskCacheininternal/vaultik/blobcache.go) via PR #34, which closed duplicate issue #29.The implementation:
4 × BlobSizeLimit(configurable via config)maxBytesare silently skippedblobcache_test.goClosing as duplicate of #29.