steveyen / gkvlite

Simple, ordered, key-value persistence library for the Go Language

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

manually evict items from memory

starius opened this issue · comments

I would like to be able to evict an item (or at least its value) from memory.
Reopening a database as advised in #4 (comment) is suboptimal, as it introduces long pauses and memory usage is still rather high, because items are stored in memory all the time until I call Write, Flush and reopen the database.

Can you provide the following methods, please?

func (t *Collection) EvictValue(i *Item)
func (t *Collection) EvictItem(i *Item)

I would call one of them after I call Set or Get to reduce memory usage.