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/nse | |
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/nse')
-rw-r--r-- | src/nse/gnunet-service-nse.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/nse/gnunet-service-nse.c b/src/nse/gnunet-service-nse.c index d7fb439e2..9a9f50a96 100644 --- a/src/nse/gnunet-service-nse.c +++ b/src/nse/gnunet-service-nse.c | |||
@@ -1519,4 +1519,21 @@ main (int argc, char *const *argv) | |||
1519 | &run, NULL)) ? 0 : 1; | 1519 | &run, NULL)) ? 0 : 1; |
1520 | } | 1520 | } |
1521 | 1521 | ||
1522 | |||
1523 | #ifdef LINUX | ||
1524 | #include <malloc.h> | ||
1525 | |||
1526 | /** | ||
1527 | * MINIMIZE heap size (way below 128k) since this process doesn't need much. | ||
1528 | */ | ||
1529 | void __attribute__ ((constructor)) GNUNET_ARM_memory_init () | ||
1530 | { | ||
1531 | mallopt (M_TRIM_THRESHOLD, 4 * 1024); | ||
1532 | mallopt (M_TOP_PAD, 1 * 1024); | ||
1533 | malloc_trim (0); | ||
1534 | } | ||
1535 | #endif | ||
1536 | |||
1537 | |||
1538 | |||
1522 | /* end of gnunet-service-nse.c */ | 1539 | /* end of gnunet-service-nse.c */ |