7 #include "monitor/action/MemoryInfo.hpp" 9 #include <fwGui/dialog/MessageDialog.hpp> 11 #include <fwMemory/BufferManager.hpp> 12 #include <fwMemory/tools/MemoryMonitorTools.hpp> 14 #include <fwServices/macros.hpp> 42 std::uint64_t mo = 1024*1024;
43 std::uint64_t totalSystemMemory = ::fwMemory::tools::MemoryMonitorTools::getTotalSystemMemory();
44 std::uint64_t freeSystemMemory = ::fwMemory::tools::MemoryMonitorTools::getFreeSystemMemory();
45 std::uint64_t usedProcessMemory = ::fwMemory::tools::MemoryMonitorTools::getUsedProcessMemory();
46 std::uint64_t estimateFreeMem = ::fwMemory::tools::MemoryMonitorTools::estimateFreeMem();
48 ::fwMemory::BufferManager::SizeType managedBufferSize = 0;
49 ::fwMemory::BufferManager::SizeType dumpedBufferSize = 0;
54 managedBufferSize = stats.totalManaged;
55 dumpedBufferSize = stats.totalDumped;
57 std::stringstream stream;
58 stream <<
"Total system memory = " << totalSystemMemory/mo <<
" Mo" << std::endl;
59 stream <<
"Free system memory = " << freeSystemMemory/mo <<
" Mo" << std::endl;
60 stream <<
"Used process memory = " << usedProcessMemory/mo <<
" Mo" << std::endl;
61 stream <<
"Estimed Free memory = " << estimateFreeMem/mo <<
" Mo" << std::endl;
62 stream <<
"ManagedBuffer size = " << managedBufferSize/mo <<
" Mo" << std::endl;
63 stream <<
"DumpedBuffer size = " << dumpedBufferSize/mo <<
" Mo" << std::endl;
69 ::fwGui::dialog::IMessageDialog::INFO);
FWGUI_API void actionServiceStarting()
Method called when the action service is starting.
static FWGUI_API IMessageDialog::Buttons showMessageDialog(const std::string &title, const std::string &message,::fwGui::dialog::IMessageDialog::Icons icon=INFO)
static FWMEMORY_API BufferManager::sptr getDefault()
Returns the current BufferManager instance.
FWGUI_API void actionServiceStopping()
Method called when the action service is stopping.
Defines the service interface managing the menu items.
void updating() override
Shows in a message box few memory information.
FWGUI_API void initialize()
Initialize the action.
Base class for each data object.
void stopping() override
Calls classic IAction methods to stop.
The namespace monitor contains tools for monitoring an application built with FW4SPL.
Implements an action to show in a message box few memory information.
void configuring() override
Calls classic IAction methods to configure.
virtual MONITOR_API ~MemoryInfo() noexcept
Does nothing.
MONITOR_API MemoryInfo() noexcept
Does nothing.
void starting() override
Calls classic IAction methods to start.