59 # include "thread_bsd.inline.hpp"
60 #endif
61
62 void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
63 bool clear_all_softrefs) {
64 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
65
66 GenCollectedHeap* gch = GenCollectedHeap::heap();
67 #ifdef ASSERT
68 if (gch->collector_policy()->should_clear_all_soft_refs()) {
69 assert(clear_all_softrefs, "Policy should have been checked earlier");
70 }
71 #endif
72
73 // hook up weak ref data so it can be used during Mark-Sweep
74 assert(ref_processor() == NULL, "no stomping");
75 assert(rp != NULL, "should be non-NULL");
76 _ref_processor = rp;
77 rp->setup_policy(clear_all_softrefs);
78
79 TraceTime t1("Full GC", PrintGC && !PrintGCDetails, true, gclog_or_tty);
80
81 // When collecting the permanent generation methodOops may be moving,
82 // so we either have to flush all bcp data or convert it into bci.
83 CodeCache::gc_prologue();
84 Threads::gc_prologue();
85
86 // Increment the invocation count for the permanent generation, since it is
87 // implicitly collected whenever we do a full mark sweep collection.
88 gch->perm_gen()->stat_record()->invocations++;
89
90 // Capture heap size before collection for printing.
91 size_t gch_prev_used = gch->used();
92
93 // Some of the card table updates below assume that the perm gen is
94 // also being collected.
95 assert(level == gch->n_gens() - 1,
96 "All generations are being collected, ergo perm gen too.");
97
98 // Capture used regions for each generation that will be
99 // subject to collection, so that card table adjustments can
|
59 # include "thread_bsd.inline.hpp"
60 #endif
61
62 void GenMarkSweep::invoke_at_safepoint(int level, ReferenceProcessor* rp,
63 bool clear_all_softrefs) {
64 assert(SafepointSynchronize::is_at_safepoint(), "must be at a safepoint");
65
66 GenCollectedHeap* gch = GenCollectedHeap::heap();
67 #ifdef ASSERT
68 if (gch->collector_policy()->should_clear_all_soft_refs()) {
69 assert(clear_all_softrefs, "Policy should have been checked earlier");
70 }
71 #endif
72
73 // hook up weak ref data so it can be used during Mark-Sweep
74 assert(ref_processor() == NULL, "no stomping");
75 assert(rp != NULL, "should be non-NULL");
76 _ref_processor = rp;
77 rp->setup_policy(clear_all_softrefs);
78
79 TraceTime t1(GCCauseString("Full GC", gch->gc_cause()), PrintGC && !PrintGCDetails, true, gclog_or_tty);
80
81 // When collecting the permanent generation methodOops may be moving,
82 // so we either have to flush all bcp data or convert it into bci.
83 CodeCache::gc_prologue();
84 Threads::gc_prologue();
85
86 // Increment the invocation count for the permanent generation, since it is
87 // implicitly collected whenever we do a full mark sweep collection.
88 gch->perm_gen()->stat_record()->invocations++;
89
90 // Capture heap size before collection for printing.
91 size_t gch_prev_used = gch->used();
92
93 // Some of the card table updates below assume that the perm gen is
94 // also being collected.
95 assert(level == gch->n_gens() - 1,
96 "All generations are being collected, ergo perm gen too.");
97
98 // Capture used regions for each generation that will be
99 // subject to collection, so that card table adjustments can
|