mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 13:04:15 -04:00
Add warning on low memory limit
This commit is contained in:
parent
c19c426968
commit
58b23cebe8
@ -795,6 +795,15 @@ int mkdwarfs(int argc, char** argv) {
|
||||
block_compressor schema_bc(schema_compression);
|
||||
block_compressor metadata_bc(metadata_compression);
|
||||
|
||||
size_t min_memory_req = num_workers * (1 << cfg.block_size_bits);
|
||||
|
||||
if (mem_limit < min_memory_req && compression != "null") {
|
||||
LOG_WARN << "low memory limit (" << size_with_unit(mem_limit) << "), need "
|
||||
<< size_with_unit(min_memory_req) << " to efficiently compress "
|
||||
<< size_with_unit(1 << cfg.block_size_bits) << " blocks with "
|
||||
<< num_workers << " threads";
|
||||
}
|
||||
|
||||
filesystem_writer fsw(ofs, lgr, wg_compress, prog, bc, schema_bc, metadata_bc,
|
||||
mem_limit);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user