File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change 2323#include < boost/property_tree/ptree.hpp>
2424#include < thread>
2525#include < time.h>
26+ #include < sys/mman.h>
2627
2728#include " DataBlock.h"
2829#include " DataBlockContainer.h"
@@ -1235,6 +1236,11 @@ class ReadoutOCCStateMachine : public RuntimeControlledObject
12351236// the main program loop
12361237int main (int argc, char * argv[])
12371238{
1239+ // before anything, ensure all memory used by readout is kept in RAM
1240+ bool memLockSuccess = false ;
1241+ if (mlockall (MCL_CURRENT | MCL_FUTURE) == 0 ) {
1242+ memLockSuccess = true ;
1243+ }
12381244
12391245 // check environment settings
12401246
@@ -1265,6 +1271,11 @@ int main(int argc, char* argv[])
12651271 return err;
12661272 }
12671273
1274+ // report memlock status
1275+ if (!memLockSuccess) {
1276+ theLog.log (LogWarningSupport_ (3230 ), " Failed to lock readout memory" );
1277+ }
1278+
12681279 if (occMode) {
12691280#ifdef WITH_OCC
12701281 theLog.log (LogInfoDevel, " Readout entering OCC state machine" );
You can’t perform that action at this time.
0 commit comments