The 64kb pages issue turned out to be really simple. HotSpot reserves a bunch of pages at the end of the stack for overflow recovery. There’s one “red” page, two “yellow” pages, and three “shadow zone” pages. I don’t know what any of these pages actually do, but I do know that a 512k stack of eight 64k pages less six reserved pages and one glibc guard page leaves… 64k for everything else. It was throwing a StackOverflowError
because it was actually running out of stack.