JDK-4741093 : Java HotSpot(TM) Client VM warning: Attempt to allocate stack guard pages failed
Type:Bug
Component:hotspot
Sub-Component:runtime
Affected Version:solaris_9
Priority:P4
Status:Closed
Resolution:Fixed
OS:solaris_9
CPU:sparc
Submitted:2002-09-04
Updated:2012-10-08
Resolved:2002-11-13
The Version table provides details related to the release that this issue/RFE will be addressed.
Unresolved : Release in which this issue/RFE will be addressed. Resolved: Release in which this issue/RFE has been resolved. Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.
EVALUATION
This was failing with 64k (or larger) base page sizes due to having
defaults that weren't aligned (codeCache) or our policy of subtracting
3 guard pages (ThreadStackSize).
We need to round the code cache to the os's page size.
The approriate (least amount of surprise) fix for the ThreadStackSize
problem is to leave it as is for 8k page sizes (subtracting the 3 pages)
but for larger than 8k pages, we'll ADD the 3 guard pages to the size requested.
11-06-2004
WORK AROUND
Workaround would be:
-XX:InitialCodeCacheSize=196608 -Xss512k
11-06-2004
SUGGESTED FIX
There are 2 problems to fix. One in src/os/solaris/vm/os_solaris.cpp,
after discussions with Dave Dice and Dave Stoutamire on the ThreadStackSize
problem produced this code in os::init_2()
// For Solaris 10+, there will be a 64kb page size, which makes
// the usable default stack size quite a bit less. Increase the
// stack for 64kb (or any > than 8kb) pages, this increases
// virtual memory fragmentation (since we're not creating the
// stack on a power of 2 boundary. The real fix for this
// should be to fix the guard page mechanism.
if (vm_page_size() > 8*K) {
threadStackSizeInBytes = (threadStackSizeInBytes != 0)
? threadStackSizeInBytes + (3 * vm_page_size())
: 0;
ThreadStackSize = threadStackSizeInBytes/K;
}
Then in src/share/vm/code/codeCache.cpp I changed the "checks" for
alignment to "round_up"
// This was originally just a check of the alignment, causing failure, instead, round
// the code cache to the page size. In particular, Solaris is moving to a larger
// default page size.
CodeCacheExpansionSize = round_to(CodeCacheExpansionSize, os::vm_page_size());
InitialCodeCacheSize = round_to(InitialCodeCacheSize, os::vm_page_size());
ReservedCodeCacheSize = round_to(ReservedCodeCacheSize, os::vm_page_size());