Changeset: 8888a8f457dd for MonetDB
URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=8888a8f457dd
Modified Files:
        configure.ag
        gdk/gdk_utils.mx
Branch: Apr2011
Log Message:

memory: drop getrlimit code block

The getrlimit approach was meant to detect memory-limited environments,
however, in practice it never does what it was supposed to do (except on
Solaris).

On Darwin, the data size is by default set to 6MiB, causing a default of
6MiB memory to be detected.  We can in reality allocate much more than
that.  The OS uses it as hint for victim choosing when memory shortage
occurs anyway.  On Linux the limit is never respected.  In short, nice
idea, but it doesn't quite work out as intended, and only seems to
confuse.
(transplanted from fc6142f33071f0172c75ac19e77c425e467a3a08)


diffs (58 lines):

diff --git a/configure.ag b/configure.ag
--- a/configure.ag
+++ b/configure.ag
@@ -2706,7 +2706,6 @@
                                getlogin \
                                getopt \
                                getopt_long \
-                               getrlimit \
                                GetSystemInfo \
                                gettimeofday \
                                getuid \
diff --git a/gdk/gdk_utils.mx b/gdk/gdk_utils.mx
--- a/gdk/gdk_utils.mx
+++ b/gdk/gdk_utils.mx
@@ -67,17 +67,6 @@
 # include <sys/sysctl.h>
 #endif
 
-/* getrlimit on FreeBSD */
-#ifdef HAVE_SYS_TYPES_H
-# include <sys/types.h>
-#endif
-#ifdef HAVE_SYS_TIME_H
-# include <sys/time.h>
-#endif
-#ifdef HAVE_SYS_RESOURCE_H
-# include <sys/resource.h>
-#endif
-
 #ifdef NATIVE_WIN32
 #define chdir _chdir
 #endif
@@ -556,25 +545,6 @@
 #else
 # error "don't know how to get the amount of physical memory for your OS"
 #endif
-
-#ifdef HAVE_GETRLIMIT
-       {
-               struct rlimit rl;
-               size_t memlim;
-
-               /* The environment can be limited memory wise.  In such case the
-                * physically available memory, is not necessarily what we can
-                * also use. */
-               getrlimit(RLIMIT_DATA, &rl);
-               if (rl.rlim_cur != (rlim_t) RLIM_INFINITY) {
-                       /* rlimit returns in bytes, recalculate */
-                       memlim = rl.rlim_cur / _MT_pagesize;
-                       /* if it's more restrictive, take that as value */
-                       if (memlim < _MT_npages)
-                               _MT_npages = memlim;
-               }
-       }
-#endif
 }
 
 size_t
_______________________________________________
Checkin-list mailing list
[email protected]
http://mail.monetdb.org/mailman/listinfo/checkin-list

Reply via email to