Skip to content

Instantly share code, notes, and snippets.

View dli7077's full-sized avatar

Devin Li dli7077

  • New York
View GitHub Profile
@dli7077
dli7077 / memory_check.cpp
Created October 21, 2022 16:49 — forked from thirdwing/memory_check.cpp
C++ code to print out runtime memory usage
#include <iostream>
#include <fstream>
#include <unistd.h>
void process_mem_usage(double& vm_usage, double& resident_set)
{
vm_usage = 0.0;
resident_set = 0.0;
// the two fields we want