[gimp/gimp-2-8] app: limit the pyhsical memory size by G_MAXSIZE



commit 7bbd29b182eeda62ae72ec641d3cece26541c12a
Author: Michael Natterer <mitch gimp org>
Date:   Sat Oct 13 22:44:15 2012 +0200

    app: limit the pyhsical memory size by G_MAXSIZE
    
    because one process can't handle more.
    (cherry picked from commit 2b714fcb1a6c24bcaeb13b1c592a365c374f96d8)

 app/config/gimpbaseconfig.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/app/config/gimpbaseconfig.c b/app/config/gimpbaseconfig.c
index 0fa1e60..d643943 100644
--- a/app/config/gimpbaseconfig.c
+++ b/app/config/gimpbaseconfig.c
@@ -142,6 +142,9 @@ gimp_base_config_class_init (GimpBaseConfigClass *klass)
 
   memory_size = get_physical_memory_size ();
 
+  /* limit to the amount one process can handle */
+  memory_size = MIN (G_MAXSIZE, memory_size);
+
   if (memory_size > 0)
     memory_size = memory_size / 2; /* half the memory */
   else



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]