Add peak memory usage to --stats

This commit is contained in:
Geza Lore 2026-05-07 20:28:34 -05:00
parent 752b77ea77
commit db8b6ce26d
1 changed files with 6 additions and 0 deletions

View File

@ -233,6 +233,12 @@ void V3Stats::infoHeader(std::ofstream& os, const string& prefix) {
void V3Stats::statsReport() {
UINFO(2, __FUNCTION__ << ":");
uint64_t memPeak;
uint64_t memCurrent;
VlOs::memUsageBytes(memPeak /*ref*/, memCurrent /*ref*/);
const double memory = memPeak / 1024.0 / 1024.0;
V3Stats::addStat("Peak Memory Usage (MB)", memory);
// Open stats file
const string filename
= v3Global.opt.hierTopDataDir() + "/" + v3Global.opt.prefix() + "__stats.txt";