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

Stack size is too small for arm64 platform #192

Closed
maaaace opened this issue Oct 10, 2019 · 7 comments
Closed

Stack size is too small for arm64 platform #192

maaaace opened this issue Oct 10, 2019 · 7 comments
Labels
question Usability question, not directly related to an error with the image

Comments

@maaaace
Copy link

maaaace commented Oct 10, 2019

Currently I try to run cassandra through official images, but the container cannot be started as "The stack size specified is too small, Specify at least 328k".

My docker environment is on 64bit ARMv8 Kunpeng920 CPU and I'v checked the architecture of image is "arm64".
image

After checking the option "-Xss" in jvm.options or cassandra-env.sh locating in the container, I find all of them are using "-Xss256k".
image

@wglambert wglambert added the question Usability question, not directly related to an error with the image label Oct 10, 2019
@wglambert
Copy link

Same issue as #174, it wasn't able to be reproduced and when he used Ubuntu there wasn't an issue

You could try Docker's memory limit flag -m 3.5G
https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory

@yosifkit
Copy link
Member

Yeah, I'd say this is a duplicate of #174 and the conclusion from the person reporting the issue was that it was host OS related (both on Centos 7, but Ubuntu worked fine). Can you give any more details that would prove otherwise?

@maaaace
Copy link
Author

maaaace commented Oct 11, 2019

@wglambert
Appreciate your suggestion. I've tried memory limit flag but it does not work.

@maaaace
Copy link
Author

maaaace commented Oct 11, 2019

@yosifkit I did further investigation about this issue. have to say this is OS related and also the architecutre causes it together.

Follow your suggestion, I upgrade Docker version on both CentOS and Ubuntu. Here is the result.
image
This table indicates that all the images fail to start a container with the error message "The stack size specified is too small, Specify at least 328k".

After adjusting -Xss on arm64 Ubuntu and x86 CentOS, I find the minimal stack size per thread of each OS/architecture are different.
arm64 CentOS7.6 328k
arm64 Ubuntu18.04 164k
x86 CentOS7.6 228k

Checking openjdk-1.8.0 source code, the error is from code snippet below.
image
It shows min_stack_allowed is related to StackYellowPage, StackRedPage, StackShadowPage, OS page size and VM default page size(8k). StackYellow/Red/ShadowPage could be checked with PrintFlagsFinal and page size is different corresponding to OS. Default page size of CentOS7.6 for arm64 is 64k, however, Ubuntu18.04 for arm64 and CentOS7.6 for x86 are both 4k.
arm64 CentOS7.6 64bit
image
min_stack_allowed = 3 * 64 + ( 2 * 8 + 1) * 8 = 328k

arm64 Ubuntu18.04 64bit
image
min_stack_allowed = 7 * 4 + ( 2 * 8 + 1) * 8 = 164k

x86 CentOS7.6 64bit
image
min_stack_allowed = 228k

That's the reason why CentOS7.6 for arm64 cannot start canssandra docker images as jvm option "-Xss256k". In order to support it, could we have some change on this option?
waiting for your reply, thanks a lot.

@binbinshi
Copy link

binbinshi commented Nov 30, 2019

I run it on os
Linux version 4.14.0-115.el7a.0.1.aarch64 ([email protected]) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-36) (GCC)) #1 SMP Sun Nov 25 20:54:21 UTC 2018
see the same error ;
The stack size specified is too small, Specify at least 328k Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit.

use cassandra image arm64v8/cassandra:3.11.5 ,download url https://hub.docker.com/r/arm64v8/cassandra/ ;
can anyone fix it ?

update 2019/12/02
update the config of conf/jvm.options -Xss
Per-thread stack size. -Xss512k
my problem solved;

@tianon
Copy link
Member

tianon commented Dec 20, 2023

Unfortunately, this is not something we plan to change -- CentOS 7 is very close to EOL, and we generally strive to stay as true as possible to upstream's defaults.

@tianon tianon closed this as completed Dec 20, 2023
@xtha

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Usability question, not directly related to an error with the image
Projects
None yet
Development

No branches or pull requests

6 participants