Re: [pysqlite] unusual memory behavior

Damien Elmes <resolve-5m3Em/[email protected]> Fri, 29 May 2009 23:33:57 +0900
Newsgroups gmane.comp.python.db.pysqlite.user
Message-ID <[email protected]>
Do these SQLAlchemy tests also cover the case of opening many separate
SQLite databases that I mentioned on IRC a few months ago?

On Fri, May 29, 2009 at 2:01 AM, Michael Bayer <[email protected]> w=
rote:
> Gerhard H=E4ring wrote:
>> Internally, pysqlite has these objects: connections, cursors and
>> statements. Connections need to have access to all cursors and
>> statements ever created on them. So, the connection object has a *list*
>> of weak references for cursors, and a *list* of weak references for
>> statements. To keep things simple and efficient, this list is only ever
>> appended to. The connection object has also two members
>> created_statements and created_cursors that counts the number of
>> statement and cursor allocations.
>>
>> If created_statements or created_cursors reaches 200, the corresponding
>> list is scanned for weak references that have unreachable objects (i. e.
>> that were del-ed or removed by the gc). The list is then compacted to
>> not contain any NULLs. And the counter member is reset to zero.
>
>
> thats great, since it looked like there was some internal memory
> management routine causing this to happen, and I was just curious if it
> was known.
> _______________________________________________
> list-pysqlite mailing list
> list-pysqlite-FR6EJeJVuqdwc357pe9rcyQmJico6nz3epZhswDD4dQ@public.gmane.org
> http://itsystementwicklung.de/cgi-bin/mailman/listinfo/list-pysqlite
>