This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amaury.forgeotdarc
Recipients amaury.forgeotdarc, benjamin.peterson, facundobatista, schuppenies
Date 2008-06-27.09:49:00
SpamBayes Score 0.00032697435
Marked as misclassified No
Message-id <1214560143.47.0.740606010668.issue3122@psf.upfronthosting.co.za>
In-reply-to
Content
> Caching itself is no criteria, but allocating memory without giving
> the user a chance to find out should be (in this context).
> ... calling match.regs creates a
> tuple which is not there before, but cannot be removed
> afterwards. This is why I handled it separately.

Well, so why only include the tuple, and not objects inside the tuple?
They may also count in allocated memory (not often: small numbers are
shared)

Does the same criteria apply to function.func_defaults and function.doc
members? Both can be None, sizeof(None) would be added twice.

Would you say the same for property members?

class C(object):
   def setx(self): self.__x = 42
   x = property(lambda self: self.__x)

the value is not there before you call o.setx(), and cannot be removed
afterwards.

IMO, the criteria (to decide whether a container should include a
particular PyObject member in its sizeof) should not include the way the
member  is created, or who created it, but only the current layout in
memory. For example: can other objects hold references to this member,
does it appear in gc.objects...

And I propose this simple algorithm: do not include any referenced
PyObject :-)
History
Date User Action Args
2008-06-27 09:49:03amaury.forgeotdarcsetspambayes_score: 0.000326974 -> 0.00032697435
recipients: + amaury.forgeotdarc, facundobatista, benjamin.peterson, schuppenies
2008-06-27 09:49:03amaury.forgeotdarcsetspambayes_score: 0.000326974 -> 0.000326974
messageid: <1214560143.47.0.740606010668.issue3122@psf.upfronthosting.co.za>
2008-06-27 09:49:01amaury.forgeotdarclinkissue3122 messages
2008-06-27 09:49:00amaury.forgeotdarccreate