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

Unified Diff: src/spaces.cc

Issue 9173001: Make heap size estimation more accurate. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Improved test case to do exact checking. Created 8 years, 11 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
« no previous file with comments | « src/spaces.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/spaces.cc
diff --git a/src/spaces.cc b/src/spaces.cc
index ebd3e6519208d9103a1b9d5e5bd975442d14c7fb..1bcea22b8e1850116c44ac91f384cad426888898 100644
--- a/src/spaces.cc
+++ b/src/spaces.cc
@@ -749,6 +749,20 @@ int PagedSpace::CountTotalPages() {
}
+intptr_t PagedSpace::SizeOfObjectsSlow() {
Vyacheslav Egorov (Chromium) 2012/01/10 17:42:43 we will call this function at least once at the en
Michael Starzinger 2012/01/11 09:55:57 Done. Yes, we can.
+ PageIterator it(this);
+ intptr_t size_of_objects = accounting_stats_.Size();
+ while (it.has_next()) {
+ Page* p = it.next();
+ if (!p->WasSwept()) {
+ size_of_objects -= Page::kObjectAreaSize;
+ size_of_objects += p->LiveBytes();
+ }
+ }
+ return size_of_objects - (limit() - top());
+}
+
+
void PagedSpace::ReleasePage(Page* page) {
ASSERT(page->LiveBytes() == 0);
« no previous file with comments | « src/spaces.h ('k') | test/cctest/test-heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698