Memory Allocation/Accounting bug?

From: Markus Rechberger
Date: Tue Apr 13 2010 - 14:07:16 EST


Hi,

I was doing some leaktests with our applications and couldn't really
figure out any memory leak (neither with valgrind).
Although top shows up that the application has an increased memory usage.

The sample applications:
#include <stdio.h>
#include <unistd.h>
#include <pthread.h>
#include <stdlib.h>

void *threadfunc(void *opaque) {
return NULL;
};

int main() {
pthread_t thread;

while(1) {
pthread_create(&thread, NULL, threadfunc, NULL);
pthread_join(thread, NULL);
// sleep(5);
}
return 0;
}

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
29931 markus 20 0 16480 460g 381g S 28 11986.0 0:53.00 test

RES shows up 460gig after some time which obviously is not correct

This was tested with Ubuntu Lucid (and Linux 2.6.34-rc2), someone
tested it with 2.6.32 and it seems to be fine.

Markus
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/