GNU/Linux Memory Benchmarking

T
Techtronic
Mindaugas N.
  • 14 Lap '12

Ideja - sukurti programele kuri sugebetu analyzuoti GNU Linux memory, nustatyti swappiness, numesti pagecache, dentries ir inodes, bei skirtumus parodytų vizualiai (Qwt5).

Programele naudoja Pyside+Qwt5 ir ji kaip ir baigta, liko tik viena problema:

#include <stdlib.h>
#include <stdio.h>
#include <string.h>

int main(int argc, char** argv) {
    int max = -1;
    int mb = 0;
    char* buffer;

    if(argc > 1)
        max = atoi(argv[1]);

    while((buffer=malloc(1024*1024)) != NULL && mb != max) {
        memset(buffer, 0, 1024*1024);
        mb++;
        printf("Allocated %d MB\n", mb);
        sleep(1);
    }      
return 0;
}

Reikia python way.
Gal kas turi idėjų ar pasiūlymų?