未验证 提交 a7cbbd4e 编写于 作者: A alexey-milovidov 提交者: GitHub

Update BaseDaemon.cpp

上级 399799d8
...@@ -509,15 +509,16 @@ namespace ...@@ -509,15 +509,16 @@ namespace
/// the maximum is 1000, and chromium uses 300 for its tab processes. Ignore /// the maximum is 1000, and chromium uses 300 for its tab processes. Ignore
/// whatever errors that occur, because it's just a debugging aid and we don't /// whatever errors that occur, because it's just a debugging aid and we don't
/// care if it breaks. /// care if it breaks.
#if defined(__linux__) and not defined(NDEBUG) #if defined(__linux__) && !defined(NDEBUG)
void debugIncreaseOOMScore() void debugIncreaseOOMScore()
{ {
const std::string new_score = "555"; const std::string new_score = "555";
try { try
{
DB::WriteBufferFromFile buf("/proc/self/oom_score_adj"); DB::WriteBufferFromFile buf("/proc/self/oom_score_adj");
buf.write(new_score.c_str(), new_score.size()); buf.write(new_score.c_str(), new_score.size());
} }
catch (Poco::Exception & e) catch (const Poco::Exception & e)
{ {
LOG_WARNING(&Logger::root(), "Failed to adjust OOM score: '" + LOG_WARNING(&Logger::root(), "Failed to adjust OOM score: '" +
e.displayText() + "'."); e.displayText() + "'.");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册