better btree memory management