diff --git a/src/util-thash.c b/src/util-thash.c index 6a116fae8bb0..aba009d490d2 100644 --- a/src/util-thash.c +++ b/src/util-thash.c @@ -330,6 +330,7 @@ THashTableContext *THashInit(const char *cnf_prefix, size_t data_size, ctx->config.memcap = reset_memcap ? UINT64_MAX : THASH_DEFAULT_MEMCAP; } #endif + SCLogNotice("memcap: %llu", ctx->config.memcap); ctx->config.prealloc = THASH_DEFAULT_PREALLOC; SC_ATOMIC_INIT(ctx->counter); @@ -381,6 +382,7 @@ void THashShutdown(THashTableContext *ctx) } (void) SC_ATOMIC_SUB(ctx->memuse, ctx->config.hash_size * sizeof(THashHashRow)); THashDataQueueDestroy(&ctx->spare_q); + SCLogNotice("FINAL memuse: %llu", SC_ATOMIC_GET(ctx->memuse)); DEBUG_VALIDATE_BUG_ON(SC_ATOMIC_GET(ctx->memuse) != 0); SCFree(ctx); } @@ -589,6 +591,13 @@ static THashData *THashDataGetNew(THashTableContext *ctx, void *data) /* data is initialized (recycled) but *unlocked* */ /* the recycled data was THashData and again does not include * the size of current data to be added */ + SCLogNotice("memuse: %llu", SC_ATOMIC_GET(ctx->memuse)); + SCLogNotice("config->data_size: %u, thash_data_size: %llu", (ctx)->config.data_size, + THASH_DATA_SIZE(ctx)); + SCLogNotice("sizeof(THashHashRow): %llu", sizeof(THashHashRow)); + SCLogNotice("data_size: %u", data_size); + SCLogNotice("memuse + data_size: %llu", SC_ATOMIC_GET(ctx->memuse) + data_size); + SCLogNotice("memcap: %llu", ctx->config.memcap); if (data_size > 0) { /* Since it is prealloc'd data, it already has THashData in its memuse */ (void)SC_ATOMIC_ADD(ctx->memuse, data_size); @@ -602,6 +611,7 @@ static THashData *THashDataGetNew(THashTableContext *ctx, void *data) } } + SCLogNotice("memuse: %llu", SC_ATOMIC_GET(ctx->memuse)); // setup the data BUG_ON(ctx->config.DataSet(h->data, data) != 0); (void) SC_ATOMIC_ADD(ctx->counter, 1);