Skip to content

Commit

Permalink
Revert "[MemoryPressure] MemoryPressureMonitor uses the WPE_RAM_SIZE …
Browse files Browse the repository at this point in the history
…env var"

This reverts commit d188c73.
  • Loading branch information
magomez committed Jul 9, 2020
1 parent 6156141 commit 686cd2f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion Source/WTF/wtf/MemoryPressureHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ static size_t thresholdForMemoryKillWithProcessState(WebsamProcessState processS
baseThreshold = 3 * GB;
#endif

return std::min(baseThreshold, static_cast<size_t>(ramSize() * 0.9));
return std::min(baseThreshold, static_cast<size_t>(realRamSize() * 0.9));
}

void MemoryPressureHandler::setPageCount(unsigned pageCount)
Expand Down
11 changes: 0 additions & 11 deletions Source/WebKit/UIProcess/linux/MemoryPressureMonitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <wtf/RAMSize.h>
#include <wtf/Threading.h>
#include <wtf/UniStdExtras.h>

Expand Down Expand Up @@ -191,16 +190,6 @@ static int systemMemoryUsedAsPercentage()
if (memoryAvailable > memoryTotal)
return -1;

if (getenv("WPE_RAM_SIZE")) {
// Use custom RAM size.
size_t customRAM = ramSize() / KB;
if (memoryTotal > customRAM) {
size_t memoryReduction = memoryTotal - customRAM;
memoryAvailable = memoryAvailable > memoryReduction ? memoryAvailable - memoryReduction : 0;
memoryTotal = customRAM;
}
}

return ((memoryTotal - memoryAvailable) * 100) / memoryTotal;
}

Expand Down

0 comments on commit 686cd2f

Please sign in to comment.