[Zope-dev] find unused objects: hopefully the last

Charlie Reiman creiman@kefta.com
Fri, 30 Aug 2002 09:48:36 -0700


As people already noted, this is essentially impossible for a bunch of
reasons.

...but...

You could add to Zope some sort of access counters on all objects. You could
reset this on a live site, twiddle your thumbs for a week, then dump those
counters. Objects with the smallest counters are clear candidates for
removal but you would have to make the decision with your brain or other
equivalent thought-organ. No automated process can remove all dead objects
safely in a system like Zope.

There would be a fairly large performance impact if those counters live in
the objects since then the assumption the object DB is primarly a read-only
resource would be false. However you could keep it in-core since the
counters would be just a guide and it wouldn't be much larger than the DB
index. In fact I bet you could attach such a sytem to the ZODB index logic
pretty easily...

Hmm... I think I'm talking beyond my knowledge. I think I'll shut up now.