提交 835c5284 authored 作者: thomasmueller's avatar thomasmueller

MVStore: for object data types, the cache size memory estimation was sometimes far off

上级 9ad0a0cf
......@@ -1548,6 +1548,10 @@ public class ObjectDataType implements DataType {
public Object read(ByteBuffer buff, int tag) {
int len = DataUtils.readVarInt(buff);
byte[] data = DataUtils.newBytes(len);
int size = data.length * 2;
// adjust the average size
// using an exponential moving average
averageSize = (size + 15 * averageSize) / 16;
buff.get(data);
return deserialize(data);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论