JDK-6578152 : fill_region_with_object has usability and safety issues
  • Type: Bug
  • Component: hotspot
  • Sub-Component: gc
  • Affected Version: 7
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2007-07-09
  • Updated: 2010-12-08
  • Resolved: 2009-01-30
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 6 JDK 7 Other
6u14Fixed 7Fixed hs14Fixed
Related Reports
Relates :  
Relates :  
Relates :  
Relates :  
Description
SharedHeap::fill_region_with_object has some issues with ...

Usability:  it requires a MemRegion to be passed in, but its designated purpose means that a MemRegion is almost never available at the call site, so one must be constructed just for the call, causing unnecessary obfuscation.

Safety:  it will silently fail to properly fill large regions.

Comments
SUGGESTED FIX Attached.
12-12-2008

EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/7d7a7c599c17
12-12-2008

EVALUATION Usability: Move the filler object creation code from SharedHeap to CollectedHeap since all collectors inherit from CollectedHeap. Change the interface to accept a start address and length in words and include an overloaded inline method that accepts a MemRegion for compability. Replace the custom filler object code in PSMarkSweepDecorator::insert_deadspace() and CompactibleSpace::insert_deadspace() with calls to the common routines. Use a separate Klass oop for for the filler objs (at least those large enough to be filled with an array) so they can be distinguished from user-created int arrays. Safety: allow filling of large regions (>= 8G, the largest int array) in the 64-bit VM with a routine that can create multiple filler objects. Misc: tighten up the implementation of arrayOopDesc::max_array_length(); the prior version did not use MinObjAlignment and was off by 2.
09-07-2007