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

Unified Diff: test/cctest/test-mark-compact.cc

Issue 11738004: Relax test expectations in BootUpMemoryUse. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 7 years, 12 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 | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-mark-compact.cc
diff --git a/test/cctest/test-mark-compact.cc b/test/cctest/test-mark-compact.cc
index 087db2f1d8afb9aa93eb635a8b5ff6f6dc4b1cb3..50d10218718ace5ea3c6a6da499e35daa766117f 100644
--- a/test/cctest/test-mark-compact.cc
+++ b/test/cctest/test-mark-compact.cc
@@ -473,6 +473,10 @@ static uintptr_t ReadLong(char* buffer, intptr_t* position, int base) {
}
+// The memory use computed this way is not entirely accurate and depends on
+// the way malloc allocates memory. That's why the memory usage may seem to
+// increase even though the sum of the allocated memory sizes decreases. It
+// also means that the memory use depends on the kernel and stdlib.
static intptr_t MemoryInUse() {
intptr_t memory_use = 0;
@@ -538,17 +542,18 @@ TEST(BootUpMemoryUse) {
if (initial_memory >= 0) {
InitializeVM();
intptr_t delta = MemoryInUse() - initial_memory;
- if (sizeof(initial_memory) == 8) {
+ printf("delta: %" V8_PTR_PREFIX "d kB\n", delta / 1024);
+ if (sizeof(initial_memory) == 8) { // 64-bit.
if (v8::internal::Snapshot::IsEnabled()) {
- CHECK_LE(delta, 3600 * 1024); // 3396.
+ CHECK_LE(delta, 3700 * 1024);
} else {
- CHECK_LE(delta, 4000 * 1024); // 3948.
+ CHECK_LE(delta, 4200 * 1024);
}
- } else {
+ } else { // 32-bit.
if (v8::internal::Snapshot::IsEnabled()) {
- CHECK_LE(delta, 2600 * 1024); // 2400.
+ CHECK_LE(delta, 2600 * 1024);
} else {
- CHECK_LE(delta, 3000 * 1024); // 2920.
+ CHECK_LE(delta, 3000 * 1024);
}
}
}
« no previous file with comments | « test/cctest/cctest.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698