United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: 6578152 fill_region_with_object has usability and safety issues
6578152 : fill_region_with_object has usability and safety issues

Details
Type:
Bug
Submit Date:
2007-07-09
Status:
Resolved
Updated Date:
2010-12-08
Project Name:
JDK
Resolved Date:
2009-01-30
Component:
hotspot
OS:
generic
Sub-Component:
gc
CPU:
generic
Priority:
P4
Resolution:
Fixed
Affected Versions:
7
Fixed Versions:
hs14

Related Reports
Backport:
Backport:
Relates:
Relates:
Relates:
Relates:

Sub Tasks

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
EVALUATION

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

Attached.
                                     
2008-12-12
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.
                                     
2007-07-09



Hardware and Software, Engineered to Work Together