We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1ba2c91 commit 4e0df04Copy full SHA for 4e0df04
1 file changed
Framework/Core/src/DeviceSpecHelpers.cxx
@@ -794,12 +794,12 @@ void DeviceSpecHelpers::reworkShmSegmentSize(std::vector<DataProcessorInfo>& inf
794
}
795
info.cmdLineArgs.erase(it, it + 2);
796
797
- /// If no segment size is set, make it 90% of the VSIZE.
+ /// If no segment size is set, make it max VSIZE - 1GB or 90% max VSIZE.
798
if (segmentSize == 0) {
799
struct rlimit limits;
800
getrlimit(RLIMIT_AS, &limits);
801
if (limits.rlim_cur != RLIM_INFINITY) {
802
- segmentSize = (limits.rlim_cur / 100) * 90;
+ segmentSize = std::min(limits.rlim_cur - 1000000000LL, (limits.rlim_cur * 90LL) / 100LL);
803
804
805
0 commit comments