Skip to content

Commit

Permalink
Update leveldb源码分析3.md
Browse files Browse the repository at this point in the history
fix a typo
  • Loading branch information
weinan003 committed Apr 30, 2021
1 parent 83806a9 commit 4578411
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion articles/leveldb源码分析/leveldb源码分析3.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Memtable是leveldb很重要的一块,leveldb的核心之一。我们肯定**

### 4.1 用途

在Leveldb中,所有内存中的KV数据都存储在Memtable中,物理disk则存储在SSTable中。在系统运行过程中,如果Memtable中的数据占用内存到达指定值(Options.write_buffer_size),则Leveldb就自动将Memtable转换为Memtable,并自动生成新的Memtable,也就是**Copy-On-Write机制**了。
在Leveldb中,所有内存中的KV数据都存储在Memtable中,物理disk则存储在SSTable中。在系统运行过程中,如果Memtable中的数据占用内存到达指定值(Options.write_buffer_size),则Leveldb就自动将Memtable转换为Immutable Memtable,并自动生成新的Memtable,也就是**Copy-On-Write机制**了。

Immutable Memtable则被新的线程Dump到磁盘中,Dump结束则该Immutable Memtable就可以释放了。因名知意,**Immutable Memtable是只读的**

Expand Down

0 comments on commit 4578411

Please sign in to comment.