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

Workaround for Oracle JVM to detect, recover from and prevent shrinking of R stack #102

Merged
merged 6 commits into from
Oct 11, 2017

Conversation

kalibera
Copy link
Contributor

On Linux, Oracle JVM inserts guard pages into the C stack of the initial thread, which is the main R thread in case of rJava. The stack size is limited to 2M or the maximum size given by -Xss (or its default), whichever is smaller. R needs typically a bigger stack and, yet worse, it cannot detect stack overflow anymore after the guard pages have been inserted. This patch detects when the stack is reduced and updates R stack information accordingly so that R can still detect stack overflow. Moreover, the patch includes a workaround that prevents the JVM from significantly shrinking the stack if possible. A warning is printed if the stack has still been reduced considerably. This code is only compiled and used on Linux.

@kalibera kalibera changed the title Workaround for Oracle JVM to detect, recover from and prevent shrinking or R stack Workaround for Oracle JVM to detect, recover from and prevent shrinking of R stack Apr 19, 2017
@s-u s-u merged commit f8bf3d4 into s-u:master Oct 11, 2017
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

Successfully merging this pull request may close these issues.

None yet

2 participants