14 PROCESS_MEMORY_COUNTERS_EX pmc;
15 GetProcessMemoryInfo( GetCurrentProcess(), (PROCESS_MEMORY_COUNTERS *)&pmc,
sizeof( pmc ) );
17 mem = float( pmc.WorkingSetSize / (1024. * 1024.) );
25 std::atomic< float >
_peak{ 0 };
38 _th = std::thread( [&]() {
43 _s_peak = std::max( mb, (
float)_s_peak );
44 std::this_thread::sleep_for( std::chrono::milliseconds( 10 ) );
53 TRACE(
"\n\n-P------------ " << heading <<
":" );
59 _s_peak = std::max( mb, (
float)_s_peak );
60 TRACE(
"-P------------ " << _s_start <<
" --> " << mb <<
" / " << _s_peak
61 <<
" MB delta " << (mb - _s_start) <<
" / " 62 << (_s_peak - _s_start) <<
" peak\n" );
70 TRACE(
"\n-P------------ FINAL: " << mb <<
" / " <<
_peak <<
" peak (" << _baseline
76 TRACE(
"-P------------ " << desc <<
": " <<
mb_in_use() <<
" / " << (
float)
_peak <<
" peak" );
std::atomic< float > _s_peak
std::atomic< float > _peak
float get_baseline() const
void section(char const *heading)
void snapshot(char const *desc)