gorocksdb
gorocksdb copied to clipboard
memory leak in get API
we need free slice after get from rocksdb, and copy data before return ????
appears so, I was getting data corruption on my Get calls and had to add a copy. Seems to have solved the corruption issue
result, err := db.Get(ro, key)
if err != nil {
result.Free()
panic(err.Error())
}
tmpData := make([]byte, len(result.Data()))
copy(tmpData, result.Data())
defer result.Free()
return tmpData
What about using GetBytes?
@jiminoc This free() bothered me for a few days, but it worked. Otherwise, memory will grow dramatically