JDK-7032129 : Native memory usage grow unexpectedly for vm/oom/*InternedString tests
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 7
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-03-29
  • Updated: 2011-04-25
  • Resolved: 2011-04-25
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.

To download the current JDK release, click here.
JDK 7 Other
7Fixed hs21Fixed
Related Reports
Relates :  
Description
Tests 
vm/oom/production/OOMProductionTrace_InternedString
vm/oom/production/OOMProductionAnonymousTrace_InternedString

fails on win 32 becasue they run out of native memory or 32process size.
However on this machine (sunfire004) these tests should occupy about 1G of memory.

The memory overhead is very much so it caue out of native memory error.

Comments
EVALUATION 7032129: Native memory usage grow unexpectedly for vm/oom/*InternedString tests Reviewed-by: kvn, kamg, jcoomes StringTable::verify uses as_unicode_string to verify the hash code we keep in the table but the only resource mark is outside the loop. This means that verification makes a copy of the entire StringTable in a resource area. Now that interned strings aren't in perm the StringTable can become as large as the Java heap which means verification can overflow the address space. The fix is to compute the hash directly from the char[] instead of making a copy. I moved the hash_string logic into java_lang_String and updated the users appropriately. Tested with test case that allocates interned strings until we run out of heap.
01-04-2011

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-comp/hotspot/rev/352622fd140a
01-04-2011

EVALUATION The interned string changes allow interned strings to live in main heap instead of only perm so we can allocate significantly more interned strings before running out of heap. The use of as_unicode_string in StringTable::verify creates a lot of native memory pressure during the verify since we allocate as much space here as there are char[]s interned. Maybe the code should just get a raw pointer to the char array or there should be a new routine that computes the hash directly from the array. A ResourceMark in the inner loop would work too.
29-03-2011