调整内存限制
This commit is contained in:
parent
919d156f5e
commit
24f11ff619
|
@ -2394,11 +2394,13 @@ int hg_scanner::save_usb_data(std::shared_ptr<tiny_buffer> data)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (Memoryusae > memory_size_)
|
int num = 0;
|
||||||
|
while (Memoryusae > memory_size_ && user_cancel_ && num < 20)//三个条件以防止卡死
|
||||||
{
|
{
|
||||||
|
num++;
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
std::this_thread::sleep_for(std::chrono::milliseconds(500));
|
||||||
Memoryusae = hg_log::GetAppMemoryUsage();
|
Memoryusae = hg_log::GetAppMemoryUsage();
|
||||||
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Memory Usage is Too big:%d ,Please wait -_- ...", Memoryusae);
|
VLOG_MINI_1(LOG_LEVEL_DEBUG_INFO, "Memory Usage is Too big:%f ,Please wait -_- ...\r\n", Memoryusae);
|
||||||
}
|
}
|
||||||
imgs_.Put(data);
|
imgs_.Put(data);
|
||||||
if (wait_img_.is_waiting())
|
if (wait_img_.is_waiting())
|
||||||
|
|
|
@ -28,7 +28,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include "ini_file.h"
|
#include "ini_file.h"
|
||||||
#define VMRSS_LINE 22
|
#define VMRSS_LINE 21 //实际物理内存使用率
|
||||||
#define MAX_LOG_FILE_SIZE 100 * 1024 * 1024
|
#define MAX_LOG_FILE_SIZE 100 * 1024 * 1024
|
||||||
#ifdef _INTSIZEOF
|
#ifdef _INTSIZEOF
|
||||||
#undef _INTSIZEOF
|
#undef _INTSIZEOF
|
||||||
|
|
Loading…
Reference in New Issue