RFR: 7109087: gc/7072527/TestFullGCCount.java fails when GC is set in command-line

Mikael Gerdin mikael.gerdin at oracle.com
Wed Apr 17 12:05:24 UTC 2013


Kevin,

On 2013-04-10 16:05, Kevin Walls wrote:
> Hi,
>
> I'd like a review of this testcase change.  It fails as it has a GC
> option set in the jtreg tag which may conflict with what jtreg sends,
> and fail to run.
>
> Although the test was created for a CMS problem, double-counting of full
> collections, here it is adapted to check all collectors:
>
> http://cr.openjdk.java.net/~kevinw/7109087/webrev/

Since you know the number of iterations I think it would be better to 
use an ArrayList and use list.ensureCapacity(20) to avoid allocations in 
addCollectionCount.

You could also make the GarbageCollectorMXBean list available from a 
static variable since I'm not sure what happens in that call path.

Here you access theseCounts as a List instead of a List<Long>, maybe the 
"counts" map should be a Map<String, List<Long>>?

+            for (int i = 0; i < iterations - 1; i++) {
+                List theseCounts = counts.get(collector);
+                long a = (Long) theseCounts.get(i);

/Mikael


>
> Thanks
> Kevin



More information about the hotspot-gc-dev mailing list