Commit 278beeb6 authored by erikchen's avatar erikchen Committed by Commit Bot

Remove GetProportionalSetSize.

The concept is only well-defined on Linux, but the measurement was only
implemented and used on Windows.

Bug: 819289
Change-Id: Ie69e550019e29b473c8efcae8f3c8bbc390e737b
Reviewed-on: https://chromium-review.googlesource.com/956575Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Reviewed-by: default avatarPrimiano Tucci <primiano@chromium.org>
Commit-Queue: Erik Chen <erikchen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#543435}
parent 6ba50de7
......@@ -147,9 +147,6 @@ class BASE_EXPORT ProcessMetrics {
// usage in bytes, as per definition of WorkingSetBytes. Note that this
// function is somewhat expensive on Windows (a few ms per process).
bool GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const;
// Computes pss (proportional set size) of a process. Note that this
// function is somewhat expensive on Windows (a few ms per process).
bool GetProportionalSetSizeBytes(uint64_t* pss_bytes) const;
#if defined(OS_LINUX) || defined(OS_ANDROID)
// Resident Set Size is a Linux/Android specific memory concept. Do not
......
......@@ -219,27 +219,6 @@ bool ProcessMetrics::GetWorkingSetKBytes(WorkingSetKBytes* ws_usage) const {
return true;
}
// This function calculates the proportional set size for a process.
bool ProcessMetrics::GetProportionalSetSizeBytes(uint64_t* pss_bytes) const {
double ws_pss = 0.0;
WorkingSetInformationBuffer buffer;
if (!buffer.QueryPageEntries(process_.Get()))
return false;
size_t num_page_entries = buffer.GetPageEntryCount();
for (size_t i = 0; i < num_page_entries; i++) {
if (buffer->WorkingSetInfo[i].Shared &&
buffer->WorkingSetInfo[i].ShareCount > 0)
ws_pss += 1.0 / buffer->WorkingSetInfo[i].ShareCount;
else
ws_pss += 1.0;
}
*pss_bytes = static_cast<uint64_t>(ws_pss * GetPageSize());
return true;
}
static uint64_t FileTimeToUTC(const FILETIME& ftime) {
LARGE_INTEGER li;
li.LowPart = ftime.dwLowDateTime;
......
......@@ -43,15 +43,6 @@ std::vector<mojom::VmRegionPtr> OSMetrics::GetProcessMemoryMaps(
if (!base::win::GetLoadedModulesSnapshot(::GetCurrentProcess(), &modules))
return maps;
auto process_metrics = base::ProcessMetrics::CreateCurrentProcessMetrics();
uint64_t pss_bytes = 0;
bool res = process_metrics->GetProportionalSetSizeBytes(&pss_bytes);
if (res) {
mojom::VmRegionPtr region = mojom::VmRegion::New();
region->byte_stats_proportional_resident = pss_bytes;
maps.push_back(std::move(region));
}
// Query the base address for each module, and attach it to the dump.
for (size_t i = 0; i < modules.size(); ++i) {
wchar_t module_name[MAX_PATH];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment