@@ -556,14 +556,6 @@ int main(int argc, char **argv)
556
556
nerd_init ();
557
557
timing_point ("Initialized NERD\n" );
558
558
559
- /* read in all object config data */
560
- if (result == OK ) {
561
- nm_log (NSLOG_INFO_MESSAGE , "Reading all config object data\n" );
562
- timing_point ("Reading all object data\n" );
563
- result = read_all_object_data (config_file );
564
- timing_point ("Read all object data\n" );
565
- }
566
-
567
559
/*
568
560
* the queue has to be initialized before loading the neb modules
569
561
* to give them the chance to register user events.
@@ -581,6 +573,16 @@ int main(int argc, char **argv)
581
573
launch_command_file_worker ();
582
574
timing_point ("Launched command file worker\n" );
583
575
576
+ /* read in all object config data after launching the command worker
577
+ * to keep the memory footprint of the command worker smaller
578
+ */
579
+ if (result == OK ) {
580
+ nm_log (NSLOG_INFO_MESSAGE , "Reading all config object data\n" );
581
+ timing_point ("Reading all object data\n" );
582
+ result = read_all_object_data (config_file );
583
+ timing_point ("Read all object data\n" );
584
+ }
585
+
584
586
/* initialize check workers */
585
587
timing_point ("Spawning %u workers\n" , wproc_num_workers_spawned );
586
588
if (init_workers (num_check_workers ) < 0 ) {
@@ -604,6 +606,7 @@ int main(int argc, char **argv)
604
606
nm_log (NSLOG_CONFIG_ERROR , "Error: Module loading failed. Aborting.\n" );
605
607
/* give already loaded modules a chance to deinitialize */
606
608
neb_unload_all_modules (NEBMODULE_FORCE_UNLOAD , NEBMODULE_NEB_SHUTDOWN );
609
+ shutdown_command_file_worker ();
607
610
exit (EXIT_FAILURE );
608
611
}
609
612
timing_point ("Loaded modules\n" );
0 commit comments