Fixes: NB#277092 - With Applauncher Gallery process does not release ~10 MB dirty memory when in background

RevBy: Pertti Kellomaki
pull/1/head
Dmitry Rozenshtein 14 years ago
parent 6ebc63cff4
commit d0be6945e8

2
debian/changelog vendored

@ -1,6 +1,6 @@
applauncherd (1.0.9) unstable; urgency=low
*
* Fixes: NB#277092 - With Applauncher Gallery process does not release ~10 MB dirty memory when in background
-- Nimika Keshri <nimika.1.keshri@nokia.com> Wed, 31 Aug 2011 13:30:06 +0300

@ -21,6 +21,7 @@
#include <stdio.h>
#include <dlfcn.h>
#include <string.h>
#include <malloc.h>
#include "preload.h"
@ -153,6 +154,21 @@ int main(int argc, char ** argv)
// a RAM disk.
setenv("TMPDIR", "/var/tmp", 0);
// Since this application is classified as suid application due to it's credentials
// the environment variables below are not processed by eglibc
// so we're processing this to set correct memory options
char* s = NULL;
if((s = getenv("MALLOC_TRIM_THRESHOLD_")))
mallopt(M_TRIM_THRESHOLD, atoi(s));
if((s = getenv("MALLOC_TOP_PAD_")))
mallopt(M_TOP_PAD, atoi(s));
if((s = getenv("MALLOC_PERTURB_")))
mallopt(M_PERTURB, atoi(s));
if((s = getenv("MALLOC_MMAP_THRESHOLD_")))
mallopt(M_MMAP_THRESHOLD, atoi(s));
if((s = getenv("MALLOC_MMAP_MAX_")))
mallopt(M_MMAP_MAX, atoi(s));
// Preload libraries
if (!helpWanted)
loadLibraries(gLibs, sizeof(gLibs) / sizeof(char *));

Loading…
Cancel
Save