108 Commits

Author SHA1 Message Date
Mikael Gerdin
89120e7827 7014552: gc/lock/jni/jnilockXXX works too slow on 1-processor machine
Keep a counter of how many times we were stalled by the GC locker, add a diagnostic flag which sets the limit.

Reviewed-by: brutisso, ehelin, johnc
2013-03-28 10:27:28 +01:00
Bengt Rutisson
77ebf3cbc1 8002144: G1: large number of evacuation failures may lead to large c heap memory usage
Use Stack<> instead of GrowableArray to keep track of preserved marks. Also reviewed by vitalyd@gmail.com.

Reviewed-by: johnc, jcoomes
2013-02-10 21:15:16 +01:00
John Cuthbertson
ed98ea0a88 8000311: G1: ParallelGCThreads==0 broken
Divide by zero error, if ParallelGCThreads is 0, when adjusting the PLAB size.

Reviewed-by: jmasa, jcoomes
2012-10-04 10:04:13 -07:00
John Cuthbertson
54412491e8 7190666: G1: assert(_unused == 0) failed: Inconsistency in PLAB stats
Reset the fields in ParGCAllocBuffer, that are used for accumulating values for the ResizePLAB sensors in PLABStats, to zero after flushing the values to the PLABStats fields. Flush PLABStats values only when retiring the final allocation buffers prior to disposing of a G1ParScanThreadState object, rather than when retiring every allocation buffer.

Reviewed-by: jwilhelm, jmasa, ysr
2012-09-20 09:52:56 -07:00
Bengt Rutisson
a08d48f9b1 7198130: G1: PrintReferenceGC output comes out of order
Move the first part of the GC logging, including timestamp, to the start of the GC

Reviewed-by: johnc, jwilhelm
2012-09-17 10:33:13 +02:00
Jon Masamitsu
5c58d27aac 6964458: Reimplement class meta-data storage to use native memory
Remove PermGen, allocate meta-data in metaspace linked to class loaders, rewrite GC walking, rewrite and rename metadata to be C++ classes

Co-authored-by: Stefan Karlsson <stefan.karlsson@oracle.com>
Co-authored-by: Mikael Gerdin <mikael.gerdin@oracle.com>
Co-authored-by: Tom Rodriguez <tom.rodriguez@oracle.com>
Reviewed-by: jmasa, stefank, never, coleenp, kvn, brutisso, mgerdin, dholmes, jrose, twisti, roland
2012-09-01 13:25:18 -04:00
John Cuthbertson
eb2c52c717 7041879: G1: introduce stress testing parameter to cause frequent evacuation failures
Add the flags G1EvacuationFailureALot flag (and supporting flags) to force trigger evacuation failures. The support flags control how often to trigger an evacuation failure and during which types of evacuation pause. This functionality is analogous to that of PromotionFailureALot for the other collectors.

Reviewed-by: brutisso
2012-08-28 15:20:08 -07:00
Bengt Rutisson
68bbfe24e7 7178363: G1: Remove the serial code for PrintGCDetails and make it a special case of the parallel code
Also reviewed by vitalyd@gmail.com. Introduced the WorkerDataArray class. Fixed some minor logging bugs.

Reviewed-by: johnc, mgerdin
2012-08-23 10:21:12 +02:00
John Cuthbertson
61493cd92e 7185699: G1: Prediction model discrepancies
Correct the result value of G1CollectedHeap::pending_card_num(). Change the code that calculates the GC efficiency of a non-young heap region to use historical data from mixed GCs and the actual number of live bytes when predicting how long it would take to collect the region. Changes were also reviewed by Thomas Schatzl.

Reviewed-by: azeemj, brutisso
2012-08-21 14:10:39 -07:00
Brandon Mitchell
3234f913bb 6818524: G1: use ergonomic resizing of PLABs
Employ PLABStats instances to record information about survivor and old PLABs, and use the recorded stats to adjust the sizes of survivor and old PLABS.

Reviewed-by: johnc, ysr
2012-08-06 12:20:14 -07:00
Antonios Printezis
a6580a7e63 7114678: G1: various small fixes, code cleanup, and refactoring
Various cleanups as a prelude to introducing iterators for HeapRegions.

Reviewed-by: johnc, brutisso
2012-07-19 15:15:54 -07:00
Zhengyu Gu
a39b17624a 6995781: Native Memory Tracking (Phase 1)
7151532: DCmd for hotspot native memory tracking

Implementation of native memory tracking phase 1, which tracks VM native memory usage, and related DCmd

Reviewed-by: acorn, coleenp, fparain
2012-06-28 17:03:16 -04:00
Bengt Rutisson
e294a9f5ec 7172388: G1: _total_full_collections should not be incremented for concurrent cycles
Reviewed-by: azeemj, jmasa
2012-06-05 22:30:24 +02:00
Antonios Printezis
01ea4199c7 7157073: G1: type change size_t -> uint for region counts / indexes
Change the type of fields / variables / etc. that represent region counts and indeces from size_t to uint.

Reviewed-by: iveresov, brutisso, jmasa, jwilhelm
2012-04-18 07:21:15 -04:00
Bengt Rutisson
f695b75d78 4988100: oop_verify_old_oop appears to be dead
Removed oop_verify_old_oop and allow_dirty. Also reviewed by: alexlamsl@gmail.com

Reviewed-by: jmasa, jwilhelm
2012-04-16 08:57:18 +02:00
Antonios Printezis
29afa9bf4b 7127697: G1: remove dead code after recent concurrent mark changes
Removed lots of dead code after some recent conc mark changes.

Reviewed-by: brutisso, johnc
2012-04-05 13:57:23 -04:00
Bengt Rutisson
a99b0c08d4 7130974: G1: Remove G1ParCopyHelper
Reviewed-by: tonyp, johnc
2012-03-16 09:52:57 +01:00
Antonios Printezis
be06406cb8 7132029: G1: mixed GC phase lasts for longer than it should
Revamp of the mechanism that chooses old regions for inclusion in the CSet. It simplifies the code and introduces min and max bounds on the number of old regions added to the CSet at each mixed GC to avoid pathological cases. It also ensures that when we do a mixed GC we'll always find old regions to add to the CSet (i.e., it eliminates the case where a mixed GC will collect no old regions which can happen today).

Reviewed-by: johnc, brutisso
2012-02-15 13:06:53 -05:00
Antonios Printezis
6a31970946 7129892: G1: explicit marking cycle initiation might fail to initiate a marking cycle
If we try to schedule an initial-mark GC in order to explicit start a conc mark cycle and it gets pre-empted by antoher GC, we should retry the attempt as long as it's appropriate for the GC cause.

Reviewed-by: brutisso, johnc
2012-02-14 08:21:08 -05:00
John Cuthbertson
0fa6fc2279 6484965: G1: piggy-back liveness accounting phase on marking
Remove the separate counting phase of concurrent marking by tracking the amount of marked bytes and the cards spanned by marked objects in marking task/worker thread local data structures, which are updated as individual objects are marked.

Reviewed-by: brutisso, tonyp
2012-01-12 00:06:47 -08:00
Bengt Rutisson
c11ba93098 6976060: G1: humongous object allocations should initiate marking cycles when necessary
Reviewed-by: tonyp, johnc
2012-01-16 22:10:05 +01:00
Antonios Printezis
1d3b26e52b 6888336: G1: avoid explicitly marking and pushing objects in survivor spaces
This change simplifies the interaction between GC and concurrent marking. By disabling survivor spaces during the initial-mark pause we don't need to propagate marks of objects we copy during each GC (since we never need to copy an explicitly marked object).

Reviewed-by: johnc, brutisso
2012-01-10 18:58:13 -05:00
John Cuthbertson
39d61f89a2 7121496: G1: do the per-region evacuation failure handling work in parallel
Parallelize the removal of self forwarding pointers etc. by wrapping in a HeapRegion closure, which is then wrapped inside an AbstractGangTask.

Reviewed-by: tonyp, iveresov
2011-12-23 11:14:18 -08:00
Antonios Printezis
3c0eb44a7c 7113006: G1: excessive ergo output when an evac failure happens
Introduce a flag that is set when a heap expansion attempt during a GC fails so that we do not consantly attempt to expand the heap when it's going to fail anyway. This not only prevents the excessive ergo output (which is generated when a region allocation fails) but also avoids excessive and ultimately unsuccessful expansion attempts.

Reviewed-by: jmasa, johnc
2012-01-05 05:54:01 -05:00
Jon Masamitsu
0ebc10bb13 7121618: Change type of number of GC workers to unsigned int
Change variables representing the number of GC workers to uint from int and size_t.  Change the parameter in work(int i) to work(uint worker_id).

Reviewed-by: brutisso, tonyp
2011-12-14 13:34:57 -08:00
John Cuthbertson
4976ad0ccf 7119908: G1: Cache CSet start region for each worker for subsequent reuse
Cache workers' calculated starting heap region, used for parallel iteration over the collcection set, for subsequent reuse.

Reviewed-by: tonyp, brutisso
2011-12-14 17:43:55 -08:00
Stefan Karlsson
a3943834e1 7121373: Clean up CollectedHeap::is_in
Fixed G1CollectedHeap::is_in, added tests, cleaned up comments and made Space::is_in pure virtual.

Reviewed-by: brutisso, tonyp, jcoomes
2011-12-14 12:15:26 +01:00
John Cuthbertson
a3311881b5 7112743: G1: Reduce overhead of marking closure during evacuation pauses
Parallelize the serial code that was used to mark objects reachable from survivor objects in the collection set. Some minor improvments in the timers used to track the freeing of the collection set along with some tweaks to PrintGCDetails.

Reviewed-by: tonyp, brutisso
2011-11-17 12:40:15 -08:00
Jon Masamitsu
15070123fa 6593758: RFE: Enhance GC ergonomics to dynamically choose ParallelGCThreads
Select number of GC threads dynamically based on heap usage and number of Java threads

Reviewed-by: johnc, ysr, jcoomes
2011-08-09 10:16:01 -07:00
Antonios Printezis
3cd36270b7 7097002: G1: remove a lot of unused / redundant code from the G1CollectorPolicy class
Major cleanup of the G1CollectorPolicy class. It removes a lot of unused fields and methods and also consolidates replicated information (mainly various ways of counting the number of CSet regions) into one copy.

Reviewed-by: johnc, brutisso
2011-11-18 12:52:27 -05:00
Antonios Printezis
44b419af51 7099849: G1: include heap region information in hs_err files
Reviewed-by: johnc, brutisso, poonam
2011-11-08 00:41:28 -05:00
Antonios Printezis
83958f54fb 7092309: G1: introduce old region set
Keep track of all the old regions in the heap with a heap region set.

Reviewed-by: brutisso, johnc
2011-11-07 22:11:12 -05:00
Bengt Rutisson
cfe349b1e0 7005808: G1: re-enable ReduceInitialCardMarks for G1
Remove the extra guard to allow G1 to use ReduceInitialCardMarks

Reviewed-by: jmasa, tonyp, johnc, ysr
2011-09-28 08:21:30 +02:00
Antonios Printezis
55c503aea2 7075646: G1: fix inconsistencies in the monitoring data
Fixed a few inconsistencies in the monitoring data, in particular when reported from jstat.

Reviewed-by: jmasa, brutisso, johnc
2011-09-23 16:07:49 -04:00
John Cuthbertson
1b62d10b4b 6484982: G1: process references during evacuation pauses
G1 now uses two reference processors - one is used by concurrent marking and the other is used by STW GCs (both full and incremental evacuation pauses). In an evacuation pause, the reference processor is embedded into the closures used to scan objects. Doing so causes causes reference objects to be 'discovered' by the reference processor. At the end of the evacuation pause, these discovered reference objects are processed - preserving (and copying) referent objects (and their reachable graphs) as appropriate.

Reviewed-by: ysr, jwilhelm, brutisso, stefank, tonyp
2011-09-22 10:57:37 -07:00
John Cuthbertson
3ae9021b59 7092412: G1: Some roots not marked during an initial mark that gets an evacuation failure
As a result of the changes for 7080389, an evacuation failure during an initial mark pause may result in some root objects not being marked. Pass whether the caller is a root scanning closure into the evacuation failure handling code so that the thread that successfully forwards an object to itself also marks the object.

Reviewed-by: ysr, brutisso, tonyp
2011-09-20 15:39:17 -07:00
John Cuthbertson
1bec3a1bd3 7080389: G1: refactor marking code in evacuation pause copy closures
Refactor code marking code in the evacuation pause copy closures so that an evacuated object is only marked by the thread that successfully copies it.

Reviewed-by: stefank, brutisso, tonyp
2011-08-29 10:13:06 -07:00
Bengt Rutisson
6fdb1414fa 6814390: G1: remove the concept of non-generational G1
Removed the possibility to turn off generational mode for G1.

Reviewed-by: johnc, ysr, tonyp
2011-08-19 09:30:59 +02:00
Antonios Printezis
f482091133 7039627: G1: avoid BOT updates for survivor allocations and dirty survivor regions incrementally
Refactor the allocation code during GC to use the G1AllocRegion abstraction. Use separate subclasses of G1AllocRegion for survivor and old regions. Avoid BOT updates and dirty survivor cards incrementally for the former.

Reviewed-by: brutisso, johnc, ysr
2011-08-12 11:31:06 -04:00
John Cuthbertson
144fb9dc25 7068240: G1: Long "parallel other time" and "ext root scanning" when running specific benchmark
In root processing, move the scanning of the reference processor's discovered lists to before RSet updating and scanning. When scanning the reference processor's discovered lists, use a buffering closure so that the time spent copying any reference object is correctly attributed. Also removed a couple of unused and irrelevant timers.

Reviewed-by: ysr, jmasa
2011-08-01 10:04:28 -07:00
Antonios Printezis
4597e4c7a8 7049999: G1: Make the G1PrintHeapRegions output consistent and complete
Extend and make more consistent the output from the G1PrintHeapRegions flag.

Reviewed-by: johnc, jmasa
2011-06-24 12:38:49 -04:00
Antonios Printezis
408e0b1bc1 7046182: G1: remove unnecessary iterations over the collection set
Remove two unnecessary iterations over the collection set which are supposed to prepare the RSet's of the CSet regions for parallel iterations (we'll make sure this is done incrementally). I'll piggyback on this CR the removal of the G1_REM_SET_LOGGING code.

Reviewed-by: brutisso, johnc
2011-06-21 15:23:07 -04:00
Antonios Printezis
937d6ded89 6994322: Remove the is_tlab and is_noref / is_large_noref parameters from the CollectedHeap
Remove two unused parameters from the mem_allocate() method and update its uses accordingly.

Reviewed-by: stefank, johnc
2011-06-16 15:51:57 -04:00
John Cuthbertson
b94d0b830c 7004681: G1: Extend marking verification to Full GCs
Perform a heap verification after the first phase of G1's full GC using objects' mark words to determine liveness. The third parameter of the heap verification routines, which was used in G1 to determine which marking bitmap to use in liveness calculations, has been changed from a boolean to an enum with values defined for using the mark word, and the 'prev' and 'next' bitmaps.

Reviewed-by: tonyp, ysr
2011-06-14 11:01:10 -07:00
Antonios Printezis
9332c44d84 7045330: G1: Simplify/fix the HeapRegionSeq class
7042285: G1: native memory leak during humongous object allocation
6804436: G1: heap region indices should be size_t

A series of fixes and improvements to the HeapRegionSeq class: a) replace the _regions growable array with a standard C array, b) avoid de-allocating / re-allocating HeapRegion instances when the heap shrinks / grows (fix for 7042285), c) introduce fast method to map address to HeapRegion via a "biased" array pointer, d) embed the _hrs object in G1CollectedHeap, instead of pointing to it via an indirection, e) assume that all the regions added to the HeapRegionSeq instance are contiguous, f) replace int's with size_t's for indexes (and expand that to HeapRegion as part of 6804436), g) remove unnecessary / unused methods, h) rename a couple of fields (_alloc_search_start and _seq_bottom), i) fix iterate_from() not to always start from index 0 irrespective of the region passed to it, j) add a verification method to check the HeapRegionSeq assumptions, k) always call the wrappers for _hrs.iterate(), _hrs_length(), and _hrs.at() from G1CollectedHeap, not those methods directly, and l) unify the code that expands the sequence (by either re-using or creating a new HeapRegion) and make it robust wrt to a HeapRegion allocation failing.

Reviewed-by: stefank, johnc, brutisso
2011-06-10 13:16:40 -04:00
Antonios Printezis
507bff762b 7032531: G1: enhance GC logging to include more accurate eden / survivor size transitions
This changeset extends the logging information generated by +PrintGCDetails to also print out separate size transitions for the eden, survivors, and old regions.

Reviewed-by: ysr, brutisso
2011-06-08 15:31:51 -04:00
Jon Masamitsu
6819e3739e 7041789: 30% perf regression with c2/arm following 7017732
Implement a more accurate is_scavengable()

Reviewed-by: stefank, jcoomes, ysr
2011-05-03 10:30:34 -07:00
Antonios Printezis
10f6cc7fc3 7035144: G1: nightly failure: Non-dirty cards in region that should be dirty (failures still exist...)
We should only undirty cards after we decide that they are not on a young region, not before. The fix also includes improvements to the verify_dirty_region() method which print out which cards were not found dirty.

Reviewed-by: johnc, brutisso
2011-04-29 14:59:04 -04:00
Jon Masamitsu
6663052a88 6946417: G1: Java VisualVM does not support G1 properly
Added counters for jstat

Reviewed-by: tonyp, jwilhelm, stefank, ysr, johnc
2011-04-21 10:23:44 -07:00
Antonios Printezis
12d1d9acc1 7011855: G1: non-product flag to artificially grow the heap
It introduces non-product cmd line parameter G1DummyRegionsPerGC which indicates how many "dummy" regions to allocate at the end of each GC. This allows the G1 heap to grow artificially and makes concurrent marking cycles more frequent irrespective of what the application that is running is doing. The dummy regions will be found totally empty during cleanup so this parameter can also be used to stress the concurrent cleanup operation.

Reviewed-by: brutisso, johnc
2011-04-19 15:46:59 -04:00