10 #include <sys/types.h> 12 #include <sys/sysctl.h> 13 #include <mach/mach.h> 15 #include <sys/sysinfo.h> 39 void init()
override ;
44 "Print event number every N events", 1 } ;
56 setDescription(
"Simple processor to print out the memory consumption at defined intervals" ) ;
78 struct task_basic_info t_info;
79 mach_msg_type_number_t t_info_count = TASK_BASIC_INFO_COUNT;
81 if (KERN_SUCCESS != task_info(mach_task_self(),
82 TASK_BASIC_INFO, (task_info_t)&t_info,
84 log<ERROR>() <<
"Problem accessing system information from MacOS X!"<< std::endl ;
87 <<
" Resident size is: "<< t_info.resident_size<<
" virtual size: "<<t_info.virtual_size
90 struct sysinfo memInfo;
92 unsigned long physMemUsed = memInfo.totalram - memInfo.freeram;
94 <<
" Physical memory in use: " << physMemUsed
void setRuntimeOption(ERuntimeOption option, bool value)
Force the runtime option to a given boolean value.
void init() override
Initialize the processor.
MemoryMonitorProcessor is a memory monitoring application for Marlin.
UIntParameter _howOften
Event counter.
#define MARLINMT_DECLARE_PROCESSOR(Class)
void setDescription(const std::string &desc)
Set the component description.
unsigned int _eventNumber
Whether the processor has to be executed in a critical section.
void printParameters() const
Print the component parameters.
void processEvent(EventStore *evt) override
Process an input event.
MemoryMonitorProcessor()
Constructor.