File tree Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Expand file tree Collapse file tree 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -339,7 +339,9 @@ int main(int argc, char* argv[])
339
339
" Logical size of input buffer." )
340
340
(" osize" , po::value<std::vector<size_t >>(&manual_params.osize )->multitoken (),
341
341
" Logical size of output." )
342
- (" R" , po::value<size_t >(&ramgb)->default_value ((start_memory.total_bytes + ONE_GiB - 1 ) / ONE_GiB), " Ram limit in GiB for tests." )
342
+ (" R" , po::value<size_t >(&ramgb)->default_value ((static_cast <size_t >(start_memory.total_bytes * system_memory::percentage_usable_memory)
343
+ + ONE_GiB - 1 )
344
+ / ONE_GiB), " Ram limit in GiB for tests." )
343
345
(" V" , po::value<size_t >(&vramgb)->default_value (0 ), " vram limit in GiB for tests." )
344
346
(" half_epsilon" , po::value<double >(&half_epsilon)->default_value (9.77e-4 ))
345
347
(" single_epsilon" , po::value<double >(&single_epsilon)->default_value (3.75e-5 ))
Original file line number Diff line number Diff line change @@ -70,6 +70,13 @@ struct system_memory
70
70
{
71
71
size_t total_bytes = 0 ;
72
72
size_t free_bytes = 0 ;
73
+ // Limits the amount of memory used throught the tests.
74
+ // Test RAM limit is: total_bytes * percentage_usable_memory.
75
+ // If the test system has little swap space (or there are many
76
+ // other processes running concurrently) and we are too
77
+ // aggressive with host memory usage, then the test process
78
+ // may get OOM killed.
79
+ static constexpr double percentage_usable_memory = .85 ;
73
80
};
74
81
extern system_memory start_memory;
75
82
You can’t perform that action at this time.
0 commit comments