mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 23:04:20 +01:00
31 lines
500 B
C
31 lines
500 B
C
|
#include <stdio.h>
|
||
|
#include <stdlib.h>
|
||
|
#include <assert.h>
|
||
|
#include <string.h>
|
||
|
#include <stdint.h>
|
||
|
#include <inttypes.h>
|
||
|
#include <os.h>
|
||
|
|
||
|
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);
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int main(void) {
|
||
|
int64_t rss;
|
||
|
|
||
|
os_get_max_rss(&rss);
|
||
|
printf("%I64d\n", rss);
|
||
|
do_mallocs();
|
||
|
os_get_max_rss(&rss);
|
||
|
printf("%I64d\n", rss);
|
||
|
|
||
|
return 0;
|
||
|
}
|
||
|
|
||
|
|