[
https://issues.apache.org/jira/browse/CASSANDRA-4442?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13419916#comment-13419916
]
Trevor Robinson commented on CASSANDRA-4442:
--------------------------------------------
How do you propose to determine the correct stack size for a particular
arch/version? Even with testing and measurement, it seems like it always has to
involve some sort of fudge factor, since the code is non-trivial and
ever-changing, and the VM internals are unknown.
Despite the unflattering label, scaling it based on the JVM minimum doesn't
seem unreasonable, since that value hopefully embodies some knowledge from the
VM designer about how the stack is used. Even if you want to maintain a known
arch/version table in the script, there should be some fallback logic for new
or untested versions. As 7u4 shows, even a minor version update can
significantly change stack usage, so fixed values should only be used with a
strict arch/version match.
To look at it another way, we only have 3 (fuzzy) data points now: 128k seems
to be the accepted "correct" value for Java 6 on amd64, 160k is known to be too
small for 7u4 on amd64 (CASSANDRA-4457), and 160k is way too big for 32-bit/ARM
(even in 7u4). The updated patch hits those points (fixing the stack overflow
on 7u4 amd64) and provides a better fallback for other systems than using the
_much_ larger JVM defaults (e.g. 320k for ARM and 1024k for amd64 in 7u4).
CASSANDRA-4457 may change things, but it's a difficult issue with minor
priority, so it's hard to imagine it being resolved soon.
> Stack size settings in cassandra-env.sh assume 64-bit x86
> ---------------------------------------------------------
>
> Key: CASSANDRA-4442
> URL: https://issues.apache.org/jira/browse/CASSANDRA-4442
> Project: Cassandra
> Issue Type: Bug
> Components: Core
> Affects Versions: 1.1.2
> Reporter: Trevor Robinson
> Assignee: Trevor Robinson
> Fix For: 1.1.3
>
> Attachments:
> v1-0001-CASSANDRA-4275-Use-JVM-s-reported-minimum-stack-size-o.txt,
> v1-0001-CASSANDRA-4442-Use-JVM-s-reported-minimum-stack-size-o.txt
>
>
> The fix for CASSANDRA-4275 hard-codes a 160 KB stack size when using Java 7
> on Linux. This assumes the Oracle 7u4 JVM on 64-bit x86. For systems like
> 32-bit ARM, this size is excessive (the minimum for 7u4 on ARM is 60-64 KB).
> Also, the minimum allowed value is version-dependent and is calculated
> dynamically by the JVM on startup based on Linux parameters that can also
> change. A better approach would be to query the JVM for the minimum stack
> size.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira