JDK-6866585 : debug code in ciObjectFactory too slow for large objects
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs16
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2009-07-29
  • Updated: 2010-04-28
  • Resolved: 2010-04-28
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
6u18Fixed 7Fixed hs16Fixed
Related Reports
Relates :  
Description
The attached test bigobj.java (created for bug 6845368) creates a single instance of a very large object w/65000+ fields.  It finishes in 1 second or less with a product build, but takes 5+ minutes with a fastdebug build on a fast machine.

Comments
EVALUATION http://hg.openjdk.java.net/jdk7/hotspot-gc/hotspot/rev/b32a809aab08
12-08-2009

SUGGESTED FIX changeset: 901:b32a809aab08 tag: tip user: jcoomes date: Tue Aug 11 23:24:41 2009 -0700 summary: 6866585: debug code in ciObjectFactory too slow for large objects diff -r b1773b9a2ca1 -r b32a809aab08 src/share/vm/ci/ciObjectFactory.cpp --- a/src/share/vm/ci/ciObjectFactory.cpp Sun Aug 09 17:03:51 2009 -0700 +++ b/src/share/vm/ci/ciObjectFactory.cpp Tue Aug 11 23:24:41 2009 -0700 @@ -219,24 +219,27 @@ ASSERT_IN_VM; #ifdef ASSERT - oop last = NULL; - for (int j = 0; j< _ci_objects->length(); j++) { - oop o = _ci_objects->at(j)->get_oop(); - assert(last < o, "out of order"); - last = o; + if (CIObjectFactoryVerify) { + oop last = NULL; + for (int j = 0; j< _ci_objects->length(); j++) { + oop o = _ci_objects->at(j)->get_oop(); + assert(last < o, "out of order"); + last = o; + } } #endif // ASSERT int len = _ci_objects->length(); int index = find(key, _ci_objects); #ifdef ASSERT - for (int i=0; i<_ci_objects->length(); i++) { - if (_ci_objects->at(i)->get_oop() == key) { - assert(index == i, " bad lookup"); + if (CIObjectFactoryVerify) { + for (int i=0; i<_ci_objects->length(); i++) { + if (_ci_objects->at(i)->get_oop() == key) { + assert(index == i, " bad lookup"); + } } } #endif if (!is_found_at(index, key, _ci_objects)) { - // Check in the non-perm area before putting it in the list. NonPermObject* &bucket = find_non_perm(key); if (bucket != NULL) { @@ -539,11 +542,13 @@ objects->at_put(index, obj); } #ifdef ASSERT - oop last = NULL; - for (int j = 0; j< objects->length(); j++) { - oop o = objects->at(j)->get_oop(); - assert(last < o, "out of order"); - last = o; + if (CIObjectFactoryVerify) { + oop last = NULL; + for (int j = 0; j< objects->length(); j++) { + oop o = objects->at(j)->get_oop(); + assert(last < o, "out of order"); + last = o; + } } #endif // ASSERT } diff -r b1773b9a2ca1 -r b32a809aab08 src/share/vm/runtime/globals.hpp --- a/src/share/vm/runtime/globals.hpp Sun Aug 09 17:03:51 2009 -0700 +++ b/src/share/vm/runtime/globals.hpp Tue Aug 11 23:24:41 2009 -0700 @@ -3034,6 +3034,9 @@ "Wait for this many CI accesses to occur in all compiles before " \ "beginning to throw OutOfMemoryErrors in each compile") \ \ + notproduct(bool, CIObjectFactoryVerify, false, \ + "enable potentially expensive verification in ciObjectFactory") \ + \ /* Priorities */ \ product_pd(bool, UseThreadPriorities, "Use native thread priorities") \ \
12-08-2009

EVALUATION Place the two verification loops near the top of ciObjectFactory::get() and the loop at the end of insert() under control of a new globals.hpp var, CIObjectFactoryVerify (default false). This is a short-term solution to allow 6845368 to be fixed, which includes a test case which provokes this problem.
30-07-2009

EVALUATION collect/analyzer show: Excl. User CPU Incl. User CPU Name sec. % sec. % 391.494 100.00 391.494 100.00 <Total> 333.483 85.18 390.083 99.64 ciObjectFactory::get(oop) 56.239 14.37 56.239 14.37 ciObjectFactory::insert(int,ciObject*,GrowableArray<ciObject*>*) 0.310 0.08 0.310 0.08 __pollsys 0.120 0.03 0.120 0.03 ciObjectFactory::find(oop,GrowableArray<ciObject*>*) 0.100 0.03 0.400 0.10 Interpreter
29-07-2009