Skip to content

Commit

Permalink
Merge pull request #18187 from mckellyln/hpcc-31071
Browse files Browse the repository at this point in the history
HPCC-31071 Java plugin lib init fail if stacksize (ulimit -s, -Xss) too large

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Jan 5, 2024
2 parents 15fcefc + 390dcab commit 33399bd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions plugins/javaembed/javaembed.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -966,8 +966,10 @@ static class JavaGlobalState

// Options we know we always want set
optionStrings.append("-Xrs");

#ifdef RLIMIT_STACK
// JVM has a habit of reducing the stack limit on main thread to 1M - probably dates back to when it was actually an increase...
// is this different than -XX:ThreadStackSize ?
StringBuffer stackOption("-Xss");
struct rlimit limit;
rlim_t slim = 0;
Expand All @@ -977,6 +979,9 @@ static class JavaGlobalState
slim = 8*1024*1024;
if (slim >= 1*1024*1024)
{
// 500m max resonable ?
if (slim >= 0x1f400000)
slim = 0x1f400000;
stackOption.append((__uint64) slim);
optionStrings.append(stackOption);
}
Expand Down

0 comments on commit 33399bd

Please sign in to comment.