From 017622aec57b665d519db755b95f8933edc5389e Mon Sep 17 00:00:00 2001 From: Shifu Chen Date: Thu, 7 Nov 2024 20:59:51 +0800 Subject: [PATCH] reduce pack size and pack limit to avoid possible huge memory usage --- src/common.h | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/common.h b/src/common.h index 6e01d95..7d46b96 100644 --- a/src/common.h +++ b/src/common.h @@ -29,20 +29,15 @@ const char ATCG_BASES[] = {'A', 'T', 'C', 'G'}; #pragma pack() -// the limit of the queue to store the packs -// error may happen if it generates more packs than this number -static const int PACK_NUM_LIMIT = 10000000; // how many reads one pack has -static const int PACK_SIZE = 1000; +static const int PACK_SIZE = 256; // if one pack is produced, but not consumed, it will be kept in the memory // this number limit the number of in memory packs // if the number of in memory packs is full, the producer thread should sleep -static const int PACK_IN_MEM_LIMIT = 500; +static const int PACK_IN_MEM_LIMIT = 128; -// if read number is more than this, warn it -static const int WARN_STANDALONE_READ_LIMIT = 10000; // different filtering results, bigger number means worse // if r1 and r2 are both failed, then the bigger one of the two results will be recorded