Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(190)

Unified Diff: content/child/child_discardable_shared_memory_manager.cc

Issue 2350423003: [Tentaive patch for discussion] Add Purge+Suspend metrics as UMA.
Patch Set: Add v8 heap usage Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: content/child/child_discardable_shared_memory_manager.cc
diff --git a/content/child/child_discardable_shared_memory_manager.cc b/content/child/child_discardable_shared_memory_manager.cc
index 44384491f1d4e739dadbe8a3851352bb11dc7bb0..9f44b3974f289151c0fbdcd840801d7bb58fa341 100644
--- a/content/child/child_discardable_shared_memory_manager.cc
+++ b/content/child/child_discardable_shared_memory_manager.cc
@@ -235,6 +235,13 @@ bool ChildDiscardableSharedMemoryManager::OnMemoryDump(
return heap_.OnMemoryDump(pmd);
}
+size_t ChildDiscardableSharedMemoryManager::GetMemoryUsage() const {
bashi 2016/09/22 23:28:26 It may be consistent when this returns a struct li
+ base::AutoLock lock(lock_);
+ const size_t total_size = heap_.GetSize();
+ const size_t freelist_size = heap_.GetSizeOfFreeLists();
+ return total_size - freelist_size;
+}
+
void ChildDiscardableSharedMemoryManager::ReleaseFreeMemory() {
base::AutoLock lock(lock_);

Powered by Google App Engine
This is Rietveld 408576698