Advertisement
AntonioVillanueva

Memoria analisis

May 16th, 2018
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.47 KB | None | 0 0
  1. #include <sys/types.h>
  2. #include <sys/sysinfo.h>
  3.  
  4. #include <iostream>
  5. using namespace std;
  6. int main (){
  7.    
  8.     struct sysinfo memoire;
  9.  
  10. sysinfo (&memoire);
  11.  
  12. cout <<"total "<<memoire.totalram<<endl;
  13. cout <<"libre "<<memoire.freeram<<endl;
  14. cout <<"shared "<<memoire.sharedram<<endl;
  15. cout <<memoire.bufferram<<endl;
  16. cout <<memoire.totalswap<<endl;
  17. cout <<memoire.freeswap<<endl;
  18.  
  19. cout <<endl<<"Version free --------------"<<endl;
  20.     system("free -b");
  21.    
  22.     return 0;
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement