Comment 23 for bug 582264

Revision history for this message
Romano Giannetti (romano-giannetti) wrote :

I think that the problem is a very bad page release or something like that. Once entered in the swap frenzy, the system is very difficult to reconvert. Swapoff do not work (it say no free memory) and I have to stop VirtualBox, which used half of the memory, to regain control in the system.

Again, this did not happen at all with Karmic.

If I fill the memory and push the thing to swap it happens again. I use a little program to fill the mem to test it, attached below.

Exiting VirtualBox resume normal working of the system, until you fill memory again, when swap starts load average jump high ans system became really sloppy.

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char** argv) {

        char * mem;
        long nblocks;
        int i;

        if (argc!=2) {
                fprintf(stderr, "Usage: %s <number_of_MB>\n", argv[0]);
                exit(1);
        }

        nblocks = atoi(argv[1])*1024;
        for(i=0;i<nblocks;i++) {
                mem = (char*)malloc(1024);
                mem[1]='A';
                if ((i%1024)==0) {
                        printf("%s:%4d Mbyte allocated and touched\n",
                               argv[0], (int)(i/1024));
                }
        }

       /* uncomment this to sit here while(1) {sleep(10);}*/

        return 0; /* and free */
}