JVM default stack size and 64KB base pages
Posted Aug 4, 2006 0:23 UTC (Fri) by tpepper
In reply to: JVM default stack size and 64KB base pages
Parent article: KHB: Transparent support for large pages
I don't know the full details (heard it 3rd hand like Val) exactly but as she says there was an assumption inside the JRE apparently about what page size was, they were allocating a certain number of pages thinking their stack would fit exactly in those pages and their math to traverse memory then was wrong when the pages were larger (ie: 64k instead of 4k). I thought it was a 12k stack using three 4k pages. Presumably they then got three 64k pages, with their 12k assumed stack falling entirely within the first if accessed straight from the start. Accesses to parts of the stack via the pointers to the second and third pages wouldn't actually then find their stack's data/frames...It's easy to imagine people doing unusual optimisations based on assumptions about page size.
At any rate they figured out how to work around it with an LD_PRELOAD option for their existing code pending an update.
to post comments)