Re: GC and security
- From: aahz@xxxxxxxxxxxxxxx (Aahz)
- Date: 30 Aug 2006 20:00:12 -0700
In article <44F61EEB.8040207@xxxxxxxxxxxxx>,
Les Schaffer <schaffer@xxxxxxxxxxxxx> wrote:
so i am curious. so long as i drop all reference to the passphrase
string(s), eventually it gets garbage collected and the memory recycled.
so "before long" the phrase is gone from memory.
Assuming you're talking about CPython, strings don't really participate
in garbage collection. Keep in mind that the primary mechanism for
reaping memory is reference counting, and generally as soon as the
refcount for an object goes to zero, it gets deleted from memory.
Garbage collection only gets used for objects that refer to other
objects, so it would only apply if string refcounts are being held by
GC-able objects.
Also keep in mind, of course, that deleting objects has nothing to do
with whether the memory gets overwritten...
--
Aahz (aahz@xxxxxxxxxxxxxxx) <*> http://www.pythoncraft.com/
I support the RKAB
.
- Follow-Ups:
- Re: GC and security
- From: Les Schaffer
- Re: GC and security
- References:
- GC and security
- From: Les Schaffer
- GC and security
- Prev by Date: Re: Allowing ref counting to close file items bad style?
- Next by Date: Re: How ahead are you guys in the (Python) real world?
- Previous by thread: Re: GC and security
- Next by thread: Re: GC and security
- Index(es):
Relevant Pages
|