diff --git a/hgdriver/hgdev/hg_scanner.cpp b/hgdriver/hgdev/hg_scanner.cpp index e0336b5..a3b647c 100644 --- a/hgdriver/hgdev/hg_scanner.cpp +++ b/hgdriver/hgdev/hg_scanner.cpp @@ -2394,11 +2394,13 @@ int hg_scanner::save_usb_data(std::shared_ptr data) } 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)); 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); if (wait_img_.is_waiting()) diff --git a/hgdriver/wrapper/hg_log.cpp b/hgdriver/wrapper/hg_log.cpp index 56ca9be..233e101 100644 --- a/hgdriver/wrapper/hg_log.cpp +++ b/hgdriver/wrapper/hg_log.cpp @@ -28,7 +28,7 @@ #include #include #include "ini_file.h" -#define VMRSS_LINE 22 +#define VMRSS_LINE 21 //ʵڴʹ #define MAX_LOG_FILE_SIZE 100 * 1024 * 1024 #ifdef _INTSIZEOF #undef _INTSIZEOF