Changeset 187389 in webkit


Ignore:
Timestamp:
Jul 25, 2015 7:46:20 AM (9 years ago)
Author:
clopez@igalia.com
Message:

REGRESSION (bmalloc): WebKit performance tests don't report memory stats.
https://bugs.webkit.org/show_bug.cgi?id=141247

Reviewed by Geoffrey Garen.

Meanwhile a better way of getting memory stats with bmalloc is not found
(see bug 136592), we can report as memory stats the resident set size
information that the operating system provides to us.

This at least should be good enough to get back the memory stats on the
performance tests and being able to track down memory usage regressions
at https://perf.webkit.org

  • wtf/FastMalloc.cpp:

(WTF::fastMallocStatistics): Report maxrss data as committedVMBytes.

Location:
trunk/Source/WTF
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r187339 r187389  
     12015-07-25  Carlos Alberto Lopez Perez  <clopez@igalia.com>
     2
     3        REGRESSION (bmalloc): WebKit performance tests don't report memory stats.
     4        https://bugs.webkit.org/show_bug.cgi?id=141247
     5
     6        Reviewed by Geoffrey Garen.
     7
     8        Meanwhile a better way of getting memory stats with bmalloc is not found
     9        (see bug 136592), we can report as memory stats the resident set size
     10        information that the operating system provides to us.
     11
     12        This at least should be good enough to get back the memory stats on the
     13        performance tests and being able to track down memory usage regressions
     14        at https://perf.webkit.org
     15
     16        * wtf/FastMalloc.cpp:
     17        (WTF::fastMallocStatistics): Report maxrss data as committedVMBytes.
     18
    1192015-07-24  Csaba Osztrogonác  <ossy@webkit.org>
    220
  • trunk/Source/WTF/wtf/FastMalloc.cpp

    r184448 r187389  
    3838#else
    3939#include <pthread.h>
     40#include <sys/resource.h>
    4041#endif
    4142
     
    262263FastMallocStatistics fastMallocStatistics()
    263264{
    264     // FIXME: This is incorrect; needs an implementation or to be removed.
    265     FastMallocStatistics statistics = { 0, 0, 0 };
     265
     266    // FIXME: Can bmalloc itself report the stats instead of relying on the OS?
     267    FastMallocStatistics statistics;
     268    statistics.freeListBytes = 0;
     269    statistics.reservedVMBytes = 0;
     270
     271#if OS(WINDOWS)
     272    PROCESS_MEMORY_COUNTERS resourceUsage;
     273    GetProcessMemoryInfo(GetCurrentProcess(), &resourceUsage, sizeof(resourceUsage));
     274    statistics.committedVMBytes = resourceUsage.PeakWorkingSetSize;
     275#else
     276    struct rusage resourceUsage;
     277    getrusage(RUSAGE_SELF, &resourceUsage);
     278
     279#if OS(DARWIN)
     280    statistics.committedVMBytes = resourceUsage.ru_maxrss;
     281#else
     282    statistics.committedVMBytes = resourceUsage.ru_maxrss * 1024;
     283#endif // OS(DARWIN)
     284
     285#endif // OS(WINDOWS)
    266286    return statistics;
    267287}
Note: See TracChangeset for help on using the changeset viewer.