GarbageCollector(Heap* heap, const std::string& name); virtual ~GarbageCollector() { } constchar* GetName() const { return name_.c_str();
} virtual GcType GetGcType() const = 0; virtual CollectorType GetCollectorType() const = 0; // Run the garbage collector. void Run(GcCause gc_cause, bool clear_soft_references) REQUIRES(!histogram_lock_);
Heap* GetHeap() const { return heap_;
} void RegisterPause(uint64_t nano_length); const CumulativeLogger& GetCumulativeTimings() const { return cumulative_timings_;
} // Swap the live and mark bitmaps of spaces that are active for the collector. For partial GC, // this is the allocation space, for full GC then we swap the zygote bitmaps too. void SwapBitmaps()
REQUIRES(Locks::heap_bitmap_lock_)
REQUIRES_SHARED(Locks::mutator_lock_);
uint64_t GetTotalCpuTime() const { return total_thread_cpu_time_ns_;
}
uint64_t GetTotalPausedTimeNs() REQUIRES(!histogram_lock_);
int64_t GetTotalFreedBytes() const { return total_freed_bytes_;
}
uint64_t GetTotalFreedObjects() const { return total_freed_objects_;
}
uint64_t GetTotalScannedBytes() const { return total_scanned_bytes_;
} // Reset the cumulative timings and pause histogram. void ResetMeasurements() REQUIRES(!histogram_lock_); // Returns mean cpu-time in nanoseconds. double GetMeanCpuTime() const; // Returns the estimated throughput in bytes / second.
uint64_t GetEstimatedMeanThroughput() const; // Returns how many GC iterations have been run.
size_t NumberOfIterations() const { return GetCumulativeTimings().GetIterations();
} // Returns the current GC iteration and assocated info.
Iteration* GetCurrentIteration(); const Iteration* GetCurrentIteration() const;
TimingLogger* GetTimings() { return &GetCurrentIteration()->timings_;
} // Record a free of normal objects. void RecordFree(const ObjectBytePair& freed); // Record a free of large objects. void RecordFreeLOS(const ObjectBytePair& freed); virtualvoid DumpPerformanceInfo(std::ostream& os) REQUIRES(!histogram_lock_);
// Extract RSS for GC-specific memory ranges using mincore().
uint64_t ExtractRssFromMincore(std::list<std::pair<void*, void*>>* gc_ranges)
REQUIRES(!histogram_lock_);
// Helper functions for querying if objects are marked. These are used for processing references, // and will be used for reading system weaks while the GC is running. virtual mirror::Object* IsMarked(mirror::Object* obj)
REQUIRES_SHARED(Locks::mutator_lock_) = 0; // Returns true if the given heap reference is null or is already marked. If it's already marked, // update the reference, using a CAS if the GC requires it. Otherwise, returns false. virtualbool IsNullOrMarkedHeapReference(mirror::HeapReference<mirror::Object>* obj)
REQUIRES_SHARED(Locks::mutator_lock_) = 0; // Used by reference processor. virtualvoid ProcessMarkStack() REQUIRES_SHARED(Locks::mutator_lock_) = 0; // Force mark an object. virtual mirror::Object* MarkObject(mirror::Object* obj)
REQUIRES_SHARED(Locks::mutator_lock_) = 0; virtualvoid MarkHeapReference(mirror::HeapReference<mirror::Object>* obj, bool do_atomic_update)
REQUIRES_SHARED(Locks::mutator_lock_) = 0; virtualvoid DelayReferenceReferent(ObjPtr<mirror::Class> klass,
ObjPtr<mirror::Reference> reference)
REQUIRES_SHARED(Locks::mutator_lock_) = 0;
protected: // Run all of the GC phases. virtualvoid RunPhases() REQUIRES(!Locks::mutator_lock_) = 0; // Revoke all the thread-local buffers. virtualvoid RevokeAllThreadLocalBuffers() = 0; // Deallocates unmarked objects referenced by 'obj_arr' that reside either in the // given continuous-spaces or in large-object space. WARNING: Trashes objects. void SweepArray(accounting::ObjectStack* obj_arr, bool swap_bitmaps,
std::vector<space::ContinuousSpace*>* sweep_spaces)
REQUIRES(Locks::heap_bitmap_lock_) REQUIRES_SHARED(Locks::mutator_lock_);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.