Title: [187389] trunk/Source/WTF
Revision
187389
Author
[email protected]
Date
2015-07-25 07:46:20 -0700 (Sat, 25 Jul 2015)

Log 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.

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (187388 => 187389)


--- trunk/Source/WTF/ChangeLog	2015-07-25 09:19:13 UTC (rev 187388)
+++ trunk/Source/WTF/ChangeLog	2015-07-25 14:46:20 UTC (rev 187389)
@@ -1,3 +1,21 @@
+2015-07-25  Carlos Alberto Lopez Perez  <[email protected]>
+
+        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.
+
 2015-07-24  Csaba Osztrogonác  <[email protected]>
 
         Remove the unused GCC workaround - std::is_trivially_destructible

Modified: trunk/Source/WTF/wtf/FastMalloc.cpp (187388 => 187389)


--- trunk/Source/WTF/wtf/FastMalloc.cpp	2015-07-25 09:19:13 UTC (rev 187388)
+++ trunk/Source/WTF/wtf/FastMalloc.cpp	2015-07-25 14:46:20 UTC (rev 187389)
@@ -37,6 +37,7 @@
 #include <windows.h>
 #else
 #include <pthread.h>
+#include <sys/resource.h>
 #endif
 
 #if OS(DARWIN)
@@ -261,8 +262,27 @@
 
 FastMallocStatistics fastMallocStatistics()
 {
-    // FIXME: This is incorrect; needs an implementation or to be removed.
-    FastMallocStatistics statistics = { 0, 0, 0 };
+
+    // FIXME: Can bmalloc itself report the stats instead of relying on the OS?
+    FastMallocStatistics statistics;
+    statistics.freeListBytes = 0;
+    statistics.reservedVMBytes = 0;
+
+#if OS(WINDOWS)
+    PROCESS_MEMORY_COUNTERS resourceUsage;
+    GetProcessMemoryInfo(GetCurrentProcess(), &resourceUsage, sizeof(resourceUsage));
+    statistics.committedVMBytes = resourceUsage.PeakWorkingSetSize;
+#else
+    struct rusage resourceUsage;
+    getrusage(RUSAGE_SELF, &resourceUsage);
+
+#if OS(DARWIN)
+    statistics.committedVMBytes = resourceUsage.ru_maxrss;
+#else
+    statistics.committedVMBytes = resourceUsage.ru_maxrss * 1024;
+#endif // OS(DARWIN)
+
+#endif // OS(WINDOWS)
     return statistics;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to