Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Calculation of available memory should respect resource limits #935

Closed
moritz opened this Issue Feb 17, 2013 · 5 comments

Comments

Projects
None yet
5 participants
Contributor

moritz commented Feb 17, 2013

Parrot uses an estimation of total available system memory to determine how much memory to use, and thus how often to run the GC.

It would be very useful if that estimation respected resource limits set with ulimit on Linux systems.

Currently parrot blows up with an OOM error message if it violates a hard ulimit, even though the available memory would be enough if parrot just GC'ed more often.

Contributor

moritz commented Feb 17, 2013

FYI the system call to check such resource limits seems to be getrlimit

Member

Benabik commented Feb 17, 2013

Shouldn't be too difficult, although I am short of tuits. If I (or someone else) gets parrot-shaped tuits, check in

src/platforms/*/sysmem.c
function Parrot_sysmem_amount

Owner

pmichaud commented Feb 17, 2013

On Sun, Feb 17, 2013 at 09:38:51AM -0800, Moritz Lenz wrote:

Parrot uses an estimation of total available system memory to determine how
much memory to use, and thus how often to run the GC.

See also issue #795 (this issue may be a duplicate of that one).

Pm

@ghost ghost assigned rurban Feb 17, 2013

rurban pushed a commit that referenced this issue Feb 17, 2013

[GH #935] honor user-rlimits for returned sysmem_amount (untested)
We need to check for RLIMIT_DATA and then RLIMIT_AS,
first hard, then soft limits.

rurban pushed a commit that referenced this issue Feb 17, 2013

[GH #935] add t/stress/gc.t
use from cmd-line as ./parrot t/stress/gc_2.pir 1000000
ulimit -Sv 64000
./parrot t/stress/gc_3.pir 1000000
ulimit -Sv unlimited
Owner

leto commented Mar 10, 2013

Did any of the above-mentioned commits ever get merged?

Owner

leto commented Mar 25, 2013

It seems that these commits are in the rurban/rlimit-gh935 branch which has not been merged to master. Anybody interested in taking up where @rurban left off?

rurban pushed a commit that referenced this issue Oct 25, 2014

[GH #935] honor user-rlimits for returned sysmem_amount (untested)
We need to check for RLIMIT_DATA and then RLIMIT_AS,
first hard, then soft limits.

rurban pushed a commit that referenced this issue Oct 25, 2014

[GH #935] add t/stress/gc.t
use from cmd-line as ./parrot t/stress/gc_2.pir 1000000
ulimit -Sv 64000
./parrot t/stress/gc_3.pir 1000000
ulimit -Sv unlimited

rurban pushed a commit that referenced this issue Oct 25, 2014

honor rlimit on darwin also (just RSS, not AS) GH #935
With this change and ulimit -v 640 the GC bugs are easily
reproduced now also on darwin.

rurban pushed a commit that referenced this issue Oct 25, 2014

honor rlimit on darwin also (just RSS, not AS) GH #935
With this change and ulimit -v 640 the GC bugs are easily
reproduced now also on darwin.

@rurban rurban closed this Nov 17, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment