#13880: Respect ulimit -v for GAP memory pool size
--------------------------------+-------------------------------------------
Reporter: vbraun | Owner: jason
Type: defect | Status: needs_review
Priority: blocker | Milestone: sage-5.6
Component: misc | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: Volker Braun | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Comment (by dimpase):
Replying to [comment:20 dimpase]:
> How about the following patch:
> {{{
> diff --git a/sage/misc/memory_info.py b/sage/misc/memory_info.py
> --- a/sage/misc/memory_info.py
> +++ b/sage/misc/memory_info.py
> @@ -263,7 +263,10 @@
> """
> info = self._parse_proc_meminfo()
> try:
> - return info['total_swap'] - info['Committed_AS']
> + dif = info['total_swap'] - info['Committed_AS']
> + if dif > 0:
> + return dif
> + return info['available_swap']
> except KeyError:
> return info['available_swap']
> }}}
> at least this fixes the doctests on the system in question
I actually have no clear idea why 'Committed_AS' gets into the picture
here. E.g. I read
[http://www.redhat.com/advice/tips/meminfo.html Committed_AS: An estimate
of how much RAM you would need to make a 99.99% guarantee that there never
is OOM (out of memory) for this workload. Normally the kernel will
overcommit memory. That means, say you do a 1GB malloc, nothing happens,
really. Only when you start USING that malloc memory you will get real
memory on demand, and just as much as you use. So you sort of take a
mortgage and hope the bank doesn't go bust. Other cases might include when
you mmap a file that's shared only when you write to it and you get a
private copy of that data. While it normally is shared between processes.
The Committed_AS is a guesstimate of how much RAM/swap you would need
worst-case.]
So this is a worst-case estimate, and {{{info['total_swap'] <
info['Committed_AS']}}} means, from the OS point of view, that you're
living on the edge. Well, maybe.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/13880#comment:21>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.