Skip to content

Commit

Permalink
HPCC-31071 Java plugin lib init fail if stacksize (ulimit -s, -Xss) t…
Browse files Browse the repository at this point in the history
…oo large

Signed-off-by: Mark Kelly <[email protected]>
  • Loading branch information
mckellyln committed Jan 4, 2024
1 parent d773dae commit 390dcab
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 390dcab

Please sign in to comment.