Discussion:
[Erp5-dev] treenalyser.py: Zodb inspection tool
Pelletier Vincent
2007-07-24 07:36:59 UTC
Permalink
Hi.

I commited (r15283) a tool to display FileStorage content for a given object,
recursing to subobjects to get total used space.

This script is a (heavy) modification of Zope's netspace.py tool, and adds
some features to help readability and bloat reason discovery.

Due to the (very) important nesting depth which can happen in Zodb, it is
*not* a good idea to scan the whole tree, you will probably end up with high
memory usage and python recursion depth errors - which are handled, but lead
to underestimation of total size.
--
Vincent Pelletier
Jean-Paul Smets
2007-07-24 08:03:45 UTC
Permalink
Post by Pelletier Vincent
Hi.
I commited (r15283) a tool to display FileStorage content for a given object,
recursing to subobjects to get total used space.
This script is a (heavy) modification of Zope's netspace.py tool, and adds
some features to help readability and bloat reason discovery.
Due to the (very) important nesting depth which can happen in Zodb, it is
*not* a good idea to scan the whole tree, you will probably end up with high
memory usage and python recursion depth errors - which are handled, but lead
to underestimation of total size.
I suggest that you also post this to zope mailing list. (some people
might be interested)
JPS.
--
Jean-Paul Smets-Solanes, Nexedi CEO - Tel. +33(0)6 62 05 76 14
Nexedi: Consulting and Development of Libre / Open Source Software
http://www.nexedi.com
ERP5: Libre/ Open Source ERP Software for small and medium companies
http://www.erp5.org
Pelletier Vincent
2007-07-24 08:16:48 UTC
Permalink
Post by Pelletier Vincent
I commited (r15283) a tool to display FileStorage content for a given
object, recursing to subobjects to get total used space.
Invocation sample:
$ export PYTHONPATH=/usr/lib/zope/lib/python
$ python treenalyser.py -xcp \
"root['Application']['erp5'].__Broken_state__['foo_module']" \
Data.fs

This will display size use of foo_module, displaying class of all encountered
objects and displaying their individual hexadecimal dump.
--
Vincent Pelletier
Loading...