facebook / facebook/rocksdb

Bad_alloc error on RPi

Open
#5,164 7 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
32.1k
Forks
6.9k
Avg merge
32m
Merged PRs (30d)
1

Description

### Expected behavior
Expect to run without exceptions

### Actual behavior
Got std::bad_alloc error

Configuration
- Runs on Raspberry Pi 3 (CPU: 4× ARM Cortex-A53, 1.2GHz, 1GB LPDDR2 (900 MHz))
- Used recommended parameter
// Optimization functions (https://github.com/facebook/rocksdb/blob/313e8772856524d1a05419b11e4837ed4030427b/options/options.cc#L468)
DBOptions* DBOptions::OptimizeForSmallDb() {
max_file_opening_threads = 1;
max_open_files = 5000;
return this;
}

ColumnFamilyOptions* ColumnFamilyOptions::OptimizeForSmallDb() {
write_buffer_size = 2 << 20;
target_file_size_base = 2 * 1048576;
max_bytes_for_level_base = 10 * 1048576;
soft_pending_compaction_bytes_limit = 256 * 1048576;
hard_pending_compaction_bytes_limit = 1073741824ul;
return this;
}
- This is running inside a docker container
- This bad alloc error happens randomly and at least shows up after my container runs more than 1.5 hour.
- I don't see high memory consumption by the docker container.

Questions
- Turned on Dump Statistics; what data should I share/monitor?
- Any recommended configuration parameters I should use?
- Any config parameter can be used to limit max memory usage?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.