Comment 19 for bug 159356

Revision history for this message
adam jvok (ajvok1) wrote : Re: System freeze on high memory usage

Same problem in 11.04 with AMDx64.

I have encrypted swap turned on.
On high mem use, the system freezes (completely: local keyboard/mouse/screen & remote ssh) and the only solution is a hard reboot.
Ugly.

I have 6Gb RAM and similar size swap partition.

If I turn encrypted swap off and use a regular swap partition instead, the test program below works fine (it seg faults when all memory is used as expected). But, with encrypted swap on, the whole system freezes up before the program ends.

I hope that helps locate the problem.

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
int main(int c,char** argv) {
  long l=1073741824; // 1 Gig.
  for (int i=0;i<10;i++) {
    printf("round %d\n",i);
    char* p1=(char*)malloc(l);
    if (p1==NULL) printf("Malloc failed\n");
    printf("try memset...\n");
    memset(p1,0,l);
    printf("memset ok\n");
  }
}