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

Bump default maximum stack size #11238

Merged
merged 3 commits into from
May 13, 2022
Merged

Conversation

xavierleroy
Copy link
Contributor

Now that stack allocation is entirely under the control of the OCaml runtime system, it's time to use more generous stack limits than those provided by operating systems.

This commit sets the default maximum stack size to 128 Miwords, i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms.

See #10736 and #10954 for context.

@xavierleroy xavierleroy added this to the 5.0.0 milestone May 4, 2022
@shindere
Copy link
Contributor

shindere commented May 10, 2022 via email

@xavierleroy
Copy link
Contributor Author

How about documenting in which unit the stack size is expressed? I assume it's in words

The unit is indeed words, and it's documented in the reference manual where the OCAMLRUNPARAM variable is documented, as well as in the runtime/caml/config.h source file. What extra documentation is needed?

Also, I'm sorry, I didn't understand what you did in the test. You sem
to specify a constant size, still you say that it's to make the test
robust to increases of the stack size. Would you mind clarifying?

The test wants to trigger a stack overflow. After increasing the default max stack size, it would no longer trigger it. Hence the test must be run with a fixed max stack size that is known to trigger the stack overflow.

@shindere
Copy link
Contributor

shindere commented May 10, 2022 via email

@shindere
Copy link
Contributor

@xavierleroy don't you want to add a Changes entry?

To please check-typo but also because that may be interesting to users.

Now that stack allocation is entirely under the control of the OCaml
runtime system, it's time to use more generous stack limits than
those provided by operating systems.

This commit sets the default maximum stack size to 128 Miwords,
i.e. 1 Gib for 64-bit platforms and 512 Mib for 32-bit platforms.
So that the test is robust against bumping the default max stack size.
@xavierleroy
Copy link
Contributor Author

Changes entry added, now merging !

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.

2 participants