Skip to content

Commit

Permalink
redo #6242
Browse files Browse the repository at this point in the history
revert to byte based high watermark
add mb based high watermark
  • Loading branch information
NikolajBjorner committed Aug 8, 2022
1 parent 63f48f8 commit 77a313f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/util/env_params.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,17 @@ void env_params::updt_params() {
enable_warning_messages(p.get_bool("warning", true));
memory::set_max_size(megabytes_to_bytes(p.get_uint("memory_max_size", 0)));
memory::set_max_alloc_count(p.get_uint("memory_max_alloc_count", 0));
memory::set_high_watermark(megabytes_to_bytes(p.get_uint("memory_high_watermark", 0)));
memory::set_high_watermark(p.get_uint("memory_high_watermark", 0));
unsigned mb = p.get_uint("memory_high_watermark_mb", 0);
if (mb > 0)
memory::set_high_watermark(megabytes_to_bytes(mb));
}

void env_params::collect_param_descrs(param_descrs & d) {
d.insert("verbose", CPK_UINT, "be verbose, where the value is the verbosity level", "0");
d.insert("warning", CPK_BOOL, "enable/disable warning messages", "true");
d.insert("memory_max_size", CPK_UINT, "set hard upper limit for memory consumption (in megabytes), if 0 then there is no limit", "0");
d.insert("memory_max_alloc_count", CPK_UINT, "set hard upper limit for memory allocations, if 0 then there is no limit", "0");
d.insert("memory_high_watermark", CPK_UINT, "set high watermark for memory consumption (in megabytes), if 0 then there is no limit", "0");
d.insert("memory_high_watermark", CPK_UINT, "set high watermark for memory consumption (in bytes), if 0 then there is no limit", "0");
d.insert("memory_high_watermark_mb", CPK_UINT, "set high watermark for memory consumption (in megabytes), if 0 then there is no limit", "0");
}

0 comments on commit 77a313f

Please sign in to comment.