Changeset: 1cbd4463c0c1 for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=1cbd4463c0c1
Modified Files:
        gdk/gdk_utils.c
Branch: Oct2020
Log Message:

Use the cgroup2 high memory limit if available.
This fixes #7076.


diffs (30 lines):

diff --git a/gdk/gdk_utils.c b/gdk/gdk_utils.c
--- a/gdk/gdk_utils.c
+++ b/gdk/gdk_utils.c
@@ -491,7 +491,7 @@ MT_init(void)
                                        /* assume "max" if not a number */
                                        fclose(f);
                                }
-                               /* soft limit */
+                               /* soft high limit */
                                strcpy(pth + l, "memory.high");
                                f = fopen(pth, "r");
                                if (f != NULL) {
@@ -502,6 +502,17 @@ MT_init(void)
                                        /* assume "max" if not a number */
                                        fclose(f);
                                }
+                               /* soft low limit */
+                               strcpy(pth + l, "memory.low");
+                               f = fopen(pth, "r");
+                               if (f != NULL) {
+                                       if (fscanf(f, "%" SCNu64, &mem) == 1 && 
mem < (uint64_t) _MT_pagesize * _MT_npages) {
+                                               _MT_npages = (size_t) (mem / 
_MT_pagesize);
+                                       }
+                                       success = true;
+                                       /* assume "max" if not a number */
+                                       fclose(f);
+                               }
                                /* limit of memory+swap usage
                                 * we use this as maximum virtual memory size */
                                strcpy(pth + l, "memory.swap.max");
_______________________________________________
checkin-list mailing list
[email protected]
https://www.monetdb.org/mailman/listinfo/checkin-list

Reply via email to