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

Side by Side Diff: test/cctest/heap/test-mark-compact.cc

Issue 2416573002: [test] Increase buffer for reading memory usage. (Closed)
Patch Set: Created 4 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 // The memory use computed this way is not entirely accurate and depends on 408 // The memory use computed this way is not entirely accurate and depends on
409 // the way malloc allocates memory. That's why the memory use may seem to 409 // the way malloc allocates memory. That's why the memory use may seem to
410 // increase even though the sum of the allocated object sizes decreases. It 410 // increase even though the sum of the allocated object sizes decreases. It
411 // also means that the memory use depends on the kernel and stdlib. 411 // also means that the memory use depends on the kernel and stdlib.
412 static intptr_t MemoryInUse() { 412 static intptr_t MemoryInUse() {
413 intptr_t memory_use = 0; 413 intptr_t memory_use = 0;
414 414
415 int fd = open("/proc/self/maps", O_RDONLY); 415 int fd = open("/proc/self/maps", O_RDONLY);
416 if (fd < 0) return -1; 416 if (fd < 0) return -1;
417 417
418 const int kBufSize = 10000; 418 const int kBufSize = 20000;
419 char buffer[kBufSize]; 419 char buffer[kBufSize];
420 ssize_t length = read(fd, buffer, kBufSize); 420 ssize_t length = read(fd, buffer, kBufSize);
421 intptr_t line_start = 0; 421 intptr_t line_start = 0;
422 CHECK_LT(length, kBufSize); // Make the buffer bigger. 422 CHECK_LT(length, kBufSize); // Make the buffer bigger.
423 CHECK_GT(length, 0); // We have to find some data in the file. 423 CHECK_GT(length, 0); // We have to find some data in the file.
424 while (line_start < length) { 424 while (line_start < length) {
425 if (buffer[line_start] == '\n') { 425 if (buffer[line_start] == '\n') {
426 line_start++; 426 line_start++;
427 continue; 427 continue;
428 } 428 }
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
479 479
480 480
481 TEST(RegressJoinThreadsOnIsolateDeinit) { 481 TEST(RegressJoinThreadsOnIsolateDeinit) {
482 intptr_t size_limit = ShortLivingIsolate() * 2; 482 intptr_t size_limit = ShortLivingIsolate() * 2;
483 for (int i = 0; i < 10; i++) { 483 for (int i = 0; i < 10; i++) {
484 CHECK_GT(size_limit, ShortLivingIsolate()); 484 CHECK_GT(size_limit, ShortLivingIsolate());
485 } 485 }
486 } 486 }
487 487
488 #endif // __linux__ and !USE_SIMULATOR 488 #endif // __linux__ and !USE_SIMULATOR
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698