Skip to content

Commit 4e0df04

Browse files
authored
DPL: use different logic to allocate shm-segment-size (#4046)
1 parent 1ba2c91 commit 4e0df04

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Framework/Core/src/DeviceSpecHelpers.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -794,12 +794,12 @@ void DeviceSpecHelpers::reworkShmSegmentSize(std::vector<DataProcessorInfo>& inf
794794
}
795795
info.cmdLineArgs.erase(it, it + 2);
796796
}
797-
/// If no segment size is set, make it 90% of the VSIZE.
797+
/// If no segment size is set, make it max VSIZE - 1GB or 90% max VSIZE.
798798
if (segmentSize == 0) {
799799
struct rlimit limits;
800800
getrlimit(RLIMIT_AS, &limits);
801801
if (limits.rlim_cur != RLIM_INFINITY) {
802-
segmentSize = (limits.rlim_cur / 100) * 90;
802+
segmentSize = std::min(limits.rlim_cur - 1000000000LL, (limits.rlim_cur * 90LL) / 100LL);
803803
}
804804
}
805805
if (segmentSize == 0) {

0 commit comments

Comments
 (0)