Skip to content

Instantly share code, notes, and snippets.

@jnbek
Created January 27, 2017 19:07
Show Gist options
  • Save jnbek/11881d5a291bdf50bd0db8bb115b898a to your computer and use it in GitHub Desktop.
Save jnbek/11881d5a291bdf50bd0db8bb115b898a to your computer and use it in GitHub Desktop.
Show Install Memory
#include <sys/sysinfo.h>
#include <stdio.h>
int main() {
int days, hours, mins;
struct sysinfo sys_info;
if(sysinfo(&sys_info) != 0)
perror("sysinfo");
// Total and free ram.
printf("Total Ram: %ld\n", sys_info.totalram);
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment