< prev index next >

test/hotspot/jtreg/gc/TestBigObj.java

Print this page

   10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   12  * version 2 for more details (a copy is included in the LICENSE file that
   13  * accompanied this code).
   14  *
   15  * You should have received a copy of the GNU General Public License version
   16  * 2 along with this work; if not, write to the Free Software Foundation,
   17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18  *
   19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   20  * or visit www.oracle.com if you need additional information or have any
   21  * questions.
   22  */
   23 
   24 package gc;
   25 
   26 /*
   27  * @test TestBigObj
   28  * @bug 6845368
   29  * @summary ensure gc updates references > 64K bytes from the start of the obj

   30  * @run main/othervm/timeout=720 -Xmx256m -verbose:gc gc.TestBigObj
   31  */
   32 
   33 // Allocate an object with a block of reference fields that starts more
   34 // than 64K bytes from the start of the object.  This is done with
   35 // inheritance because VMs typically rearrange the order fields appear in
   36 // memory, and group fields of the same type together within an object (i.e.,
   37 // in a single object, all reference fields could be put into a block near the
   38 // start of the object).
   39 //
   40 // A block of reference fields > 64K bytes from the start of the object would
   41 // cause HotSpot's OopMapBlock _offset field to overflow, so any references in
   42 // that block would not be updated properly after GC.
   43 //
   44 // After allocating the big object, set a reference field within the
   45 // block to a known object, provoke GC, then make sure the field was
   46 // updated properly.
   47 
   48 public class TestBigObj extends BigParent {
   49     public static Object trash;

   10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
   11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
   12  * version 2 for more details (a copy is included in the LICENSE file that
   13  * accompanied this code).
   14  *
   15  * You should have received a copy of the GNU General Public License version
   16  * 2 along with this work; if not, write to the Free Software Foundation,
   17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
   18  *
   19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   20  * or visit www.oracle.com if you need additional information or have any
   21  * questions.
   22  */
   23 
   24 package gc;
   25 
   26 /*
   27  * @test TestBigObj
   28  * @bug 6845368
   29  * @summary ensure gc updates references > 64K bytes from the start of the obj
   30  * @compile -XDnoTopInterfaceInjection TestBigObj.java
   31  * @run main/othervm/timeout=720 -Xmx256m -verbose:gc gc.TestBigObj
   32  */
   33 
   34 // Allocate an object with a block of reference fields that starts more
   35 // than 64K bytes from the start of the object.  This is done with
   36 // inheritance because VMs typically rearrange the order fields appear in
   37 // memory, and group fields of the same type together within an object (i.e.,
   38 // in a single object, all reference fields could be put into a block near the
   39 // start of the object).
   40 //
   41 // A block of reference fields > 64K bytes from the start of the object would
   42 // cause HotSpot's OopMapBlock _offset field to overflow, so any references in
   43 // that block would not be updated properly after GC.
   44 //
   45 // After allocating the big object, set a reference field within the
   46 // block to a known object, provoke GC, then make sure the field was
   47 // updated properly.
   48 
   49 public class TestBigObj extends BigParent {
   50     public static Object trash;
< prev index next >