Commit 656795fa authored by Simon Budig's avatar Simon Budig Committed by Simon Budig

when glibc is used, call mallopt, so that memory chunks >= 4k (= 64*64

2004-04-29  Simon Budig  <simon@gimp.org>

	* app/main.c: when glibc is used, call mallopt, so that memory
	chunks >= 4k (= 64*64 pixels, 1bpp - the smallest full tile)
	get allocated via mmap. This ensures that after closing an image
	the memory allocated for image data gets returned to the system.

	Thanks to Phil Blundell <pb@nexus.co.uk> for bringing mallopt
	to my attention.

	Please watch closely for performance problems.
parent f1252bab
2004-04-29 Simon Budig <simon@gimp.org>
* app/main.c: when glibc is used, call mallopt, so that memory
chunks >= 4k (= 64*64 pixels, 1bpp - the smallest full tile)
get allocated via mmap. This ensures that after closing an image
the memory allocated for image data gets returned to the system.
Thanks to Phil Blundell <pb@nexus.co.uk> for bringing mallopt
to my attention.
Please watch closely for performance problems.
2004-04-29 Michael Natterer <mitch@gimp.org>
* app/actions/Makefile.am
......
......@@ -32,6 +32,10 @@
#include <unistd.h>
#endif
#ifdef __GLIBC__
#include <malloc.h>
#endif
#ifndef WAIT_ANY
#define WAIT_ANY -1
#endif
......@@ -240,6 +244,13 @@ main (int argc,
use_shm = TRUE;
#endif
#ifdef __GLIBC__
/* Tweak memory allocation so that memory allocated in chunks >= 4k
* (64x64 pixel 1bpp tile) gets returned to the system when free'd ().
*/
mallopt (M_MMAP_THRESHOLD, 64 * 64 - 1);
#endif
batch_cmds = g_new (gchar *, argc);
batch_cmds[0] = NULL;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment