diff options
author | Christian Grothoff <christian@grothoff.org> | 2012-10-07 19:02:58 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2012-10-07 19:02:58 +0000 |
commit | 76cc98f7b32077470b413b6efce1b219906bf758 (patch) | |
tree | 206fb833e5dc4506f6d446ec3f946484469c8406 /src/util/gnunet-service-resolver.c | |
parent | a60b958f984d08525b636a2c7eae564ebec54ae6 (diff) | |
download | gnunet-76cc98f7b32077470b413b6efce1b219906bf758.tar.gz gnunet-76cc98f7b32077470b413b6efce1b219906bf758.zip |
-add logic to measure heap size for all processes that use statistics, reduce statistics, topology, nse and resolver heap usage using the same trick we used for arm
Diffstat (limited to 'src/util/gnunet-service-resolver.c')
-rw-r--r-- | src/util/gnunet-service-resolver.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/util/gnunet-service-resolver.c b/src/util/gnunet-service-resolver.c index 97eba6d11..507ecf661 100644 --- a/src/util/gnunet-service-resolver.c +++ b/src/util/gnunet-service-resolver.c | |||
@@ -577,4 +577,19 @@ main (int argc, char *const *argv) | |||
577 | return ret; | 577 | return ret; |
578 | } | 578 | } |
579 | 579 | ||
580 | #ifdef LINUX | ||
581 | #include <malloc.h> | ||
582 | |||
583 | /** | ||
584 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. | ||
585 | */ | ||
586 | void __attribute__ ((constructor)) GNUNET_ARM_memory_init () | ||
587 | { | ||
588 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); | ||
589 | mallopt (M_TOP_PAD, 1 * 1024); | ||
590 | malloc_trim (0); | ||
591 | } | ||
592 | #endif | ||
593 | |||
594 | |||
580 | /* end of gnunet-service-resolver.c */ | 595 | /* end of gnunet-service-resolver.c */ |