Commit fb04a7ba authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Add a counter for objhead allocations on the off-chance that they are

what is leaking.



git-svn-id: http://www.varnish-cache.org/svn/trunk/varnish-cache@4225 d4fa192b-c00b-0410-8231-f00ffab90ce4
parent fbe00d48
......@@ -158,6 +158,7 @@ HSH_Prealloc(const struct sess *sp)
ALLOC_OBJ(oc, OBJCORE_MAGIC);
XXXAN(oc);
w->nobjcore = oc;
w->stats.n_objectcore++;
oc->flags |= OC_F_BUSY;
}
CHECK_OBJ_NOTNULL(w->nobjcore, OBJCORE_MAGIC);
......@@ -664,6 +665,7 @@ HSH_DerefObjCore(struct sess *sp)
Lck_Unlock(&oh->mtx);
assert(oh->refcnt > 0);
FREE_OBJ(oc);
sp->wrk->stats.n_objectcore--;
if (hash->deref(oh))
return;
HSH_DeleteObjHead(sp->wrk, oh);
......@@ -766,6 +768,7 @@ HSH_Deref(struct worker *w, struct object **oo)
}
AN(oh);
FREE_OBJ(oc);
w->stats.n_objectcore--;
/* Drop our ref on the objhead */
assert(oh->refcnt > 0);
if (hash->deref(oh))
......
......@@ -52,6 +52,7 @@ MAC_STAT(backend_unused, uint64_t, 0, 'a', "Backend conn. unused")
MAC_STAT(n_sess_mem, uint64_t, 0, 'i', "N struct sess_mem")
MAC_STAT(n_sess, uint64_t, 0, 'i', "N struct sess")
MAC_STAT(n_object, uint64_t, 1, 'i', "N struct object")
MAC_STAT(n_objectcore, uint64_t, 1, 'i', "N struct objectcore")
MAC_STAT(n_objecthead, uint64_t, 1, 'i', "N struct objecthead")
MAC_STAT(n_smf, uint64_t, 0, 'i', "N struct smf")
MAC_STAT(n_smf_frag, uint64_t, 0, 'i', "N small free smf")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment