RSS释放进程内存格式

Signed-off-by: 党梓尹 <dangziyin@huawei.com>
This commit is contained in:
yinyuebuyi 2024-05-05 15:33:19 +08:00
parent fb421a3817
commit be390e38ea

View File

@ -133,7 +133,7 @@ void BgContinuousTaskMgr::ReclaimProcessMemory(int32_t pid)
std::string path = "/proc/" + std::to_string(pid) + "/reclaim";
std::string contentStr = "1";
int fd = open(path.c_str(), O_WRONLY);
if(fd < 0){
if (fd < 0) {
close(fd);
return;
}