2013-04-16 23:59:01 -04:00
|
|
|
#include <test.h>
|
2013-04-16 23:57:27 -04:00
|
|
|
#include <stdio.h>
|
|
|
|
#include <stdlib.h>
|
2013-04-16 23:58:56 -04:00
|
|
|
#include <toku_assert.h>
|
2013-04-16 23:57:27 -04:00
|
|
|
#include <string.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <inttypes.h>
|
2013-04-16 23:57:28 -04:00
|
|
|
#include <toku_os.h>
|
2013-04-16 23:57:27 -04:00
|
|
|
|
|
|
|
static void do_mallocs(void) {
|
|
|
|
int i;
|
|
|
|
for (i=0; i<1000; i++) {
|
|
|
|
int nbytes = 1024*1024;
|
|
|
|
void *vp = malloc(nbytes);
|
|
|
|
memset(vp, 0, nbytes);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-04-16 23:59:01 -04:00
|
|
|
int test_main(int argc, char *const argv[]) {
|
2013-04-16 23:57:27 -04:00
|
|
|
int64_t rss;
|
|
|
|
|
2013-04-16 23:57:28 -04:00
|
|
|
toku_os_get_max_rss(&rss);
|
2013-04-16 23:57:27 -04:00
|
|
|
printf("%I64d\n", rss);
|
|
|
|
do_mallocs();
|
2013-04-16 23:57:28 -04:00
|
|
|
toku_os_get_max_rss(&rss);
|
2013-04-16 23:57:27 -04:00
|
|
|
printf("%I64d\n", rss);
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|