File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ version.
3535 - [ Key-only iteration] ( #key-only-iteration )
3636 + [ Garbage Collection] ( #garbage-collection )
3737 + [ Database backup] ( #database-backup )
38+ + [ Memory usage] ( #memory-usage )
3839 + [ Statistics] ( #statistics )
3940 * [ Resources] ( #resources )
4041 + [ Blog Posts] ( #blog-posts )
@@ -375,6 +376,21 @@ command above to upgrade your database to work with the latest version.
375376badger_backup --dir <path/to/badgerdb> --backup-file badger.bak
376377```
377378
379+ ### Memory usage
380+
381+ Badger's memory usage is a function of:
382+
383+ - Number of memtables ` (Options::NumMemtables) `
384+ - If you modify ` NumMemtables ` , also adjust ` NumLevelZeroTables ` and
385+ ` NumLevelZeroTablesStall ` accordingly.
386+ - Number of concurrent compactions ` (Options::NumCompactors) `
387+ - Mode in which LSM tree is loaded ` (Options::TableLoadingMode) `
388+ - Size of table ` (Options::MaxTableSize) `
389+ - Size of value log file ` (Options::ValueLogFileSize) `
390+
391+ If you want to decrease the memory usage of Badger instance, tweak these
392+ options ideally doing them one at a time until you achieve the desired
393+ memory usage.
378394
379395### Statistics
380396Badger records metrics using the [ expvar] package, which is included in the Go
You can’t perform that action at this time.
0 commit comments