some optimization work...
authorChristian Grothoff <christian@grothoff.org>
Tue, 12 Apr 2011 13:34:08 +0000 (13:34 +0000)
committerChristian Grothoff <christian@grothoff.org>
Tue, 12 Apr 2011 13:34:08 +0000 (13:34 +0000)
src/arm/gnunet-service-arm.c

index c967c64e690f147fa220b8bf378364af0a6b1d38..e90d5b5a7c5b2b2bce0f150a6bd38a9d7721bb5a 100644 (file)
@@ -1115,4 +1115,19 @@ main (int argc, char *const *argv)
   return ret;
 }
 
+#ifdef LINUX
+#include <malloc.h>
+
+/**
+ * MINIMIZE heap size (way below 128k) since this process doesn't need much.
+ */
+void __attribute__ ((constructor)) GNUNET_ARM_memory_init ()
+{
+  mallopt (M_TRIM_THRESHOLD, 4*1024);
+  mallopt (M_TOP_PAD, 1*1024);
+  malloc_trim (0);
+}
+#endif
+
+
 /* end of gnunet-service-arm.c */