Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

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
Closed

Calculation of available memory should respect resource limits #935

moritz opened this issue Feb 17, 2013 · 5 comments
Assignees

Comments

@moritz
Copy link
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.

@moritz
Copy link
Contributor Author

moritz commented Feb 17, 2013

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

@Benabik
Copy link
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

@pmichaud
Copy link
Member

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
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
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
@leto
Copy link
Member

leto commented Mar 10, 2013

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

@leto
Copy link
Member

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
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
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
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
With this change and ulimit -v 640 the GC bugs are easily
reproduced now also on darwin.
@rurban rurban closed this as completed Nov 17, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants