From c528dba35b5faece51ca658fc008b688f8b690ad Mon Sep 17 00:00:00 2001 From: Mathieu Chartier Date: Tue, 26 Nov 2013 12:00:11 -0800 Subject: Enable moving classes. Slight reduction in Zygote size, memory savings are in the noise. Before: Zygote size: 8739224 After: Zygote size: 8733568 Fixed a bug where we didn't set the concurrent start bytes after switching the allocator from bump pointer to ROSAlloc in the zygote. This caused excessive memory usage. Added the method verifiers as roots to fix an issue caused by RegTypes holding a Class*. Added logic to clear card table in the SemiSpace collector, this reduces DalvikOther from ~2400k -> ~1760k when using the SemiSpace collector. Added a missing lock to the timing loggers which caused a rare one time crash in std::set. Bug: 11771255 Bug: 8499494 Bug: 10802951 Change-Id: I99d2b528cd51c1c5ed7012e3220b3aefded680ae --- runtime/base/timing_logger.cc | 2 ++ runtime/base/timing_logger.h | 7 +++---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'runtime/base') diff --git a/runtime/base/timing_logger.cc b/runtime/base/timing_logger.cc index c8dee6d..bb32b2d 100644 --- a/runtime/base/timing_logger.cc +++ b/runtime/base/timing_logger.cc @@ -43,6 +43,7 @@ CumulativeLogger::~CumulativeLogger() { } void CumulativeLogger::SetName(const std::string& name) { + MutexLock mu(Thread::Current(), lock_); name_.assign(name); } @@ -61,6 +62,7 @@ void CumulativeLogger::Reset() { } uint64_t CumulativeLogger::GetTotalNs() const { + MutexLock mu(Thread::Current(), lock_); return GetTotalTime() * kAdjust; } diff --git a/runtime/base/timing_logger.h b/runtime/base/timing_logger.h index c1ff0a3..b0bcf10 100644 --- a/runtime/base/timing_logger.h +++ b/runtime/base/timing_logger.h @@ -31,16 +31,15 @@ class TimingLogger; class CumulativeLogger { public: explicit CumulativeLogger(const std::string& name); - void prepare_stats(); ~CumulativeLogger(); void Start(); - void End(); - void Reset(); + void End() LOCKS_EXCLUDED(lock_); + void Reset() LOCKS_EXCLUDED(lock_); void Dump(std::ostream& os) LOCKS_EXCLUDED(lock_); uint64_t GetTotalNs() const; // Allow the name to be modified, particularly when the cumulative logger is a field within a // parent class that is unable to determine the "name" of a sub-class. - void SetName(const std::string& name); + void SetName(const std::string& name) LOCKS_EXCLUDED(lock_); void AddLogger(const TimingLogger& logger) LOCKS_EXCLUDED(lock_); size_t GetIterations() const; -- cgit v1.1