Skip to content

Instantly share code, notes, and snippets.

View pykello's full-sized avatar

Hadi Moshayedi pykello

View GitHub Profile
static uint64 get_memory_usage() {
uint64 result = 0;
int i = 0;
bool seenSpace = false;
char statm[1024];
FILE *statmFile = fopen("/proc/self/statm", "r");
fread(statm, 1, 1024, statmFile);
fclose(statmFile);
for (i = 0; i < 1024; i++) {