[MMTK] problem with DeterministicUniqueIDGenerator
Konrad Hinsen
hinsen at cnrs-orleans.fr
Thu Dec 18 10:56:51 UTC 2008
On 27.11.2008, at 15:14, Guido Wagner wrote:
> I used MMTK with the DeterministicUniqueIDGenerator (Utils.py) in a
> loop, which creates Universe objects from files, does some
> calculations and deletes these Universe Objects when done. The
> problem is that the id-dictionary in the
> DeterministicUniqueIDGenerator keeps references to every object in
> each universe created in the loop, so that I soon run out of
> memory. I have to empty the dictionary after each iteration.
>
> Maybe the destructor of the Universe class should be extended to
> delete all objects of the universe from the id-dictionary.
The destructor of the universe would never be called, exactly because
of the reference that still remains in the dictionary. Perhaps I
could use weak references in the dictionary, but that is something I
need to explore a bit more.
Konrad.
--
---------------------------------------------------------------------
Konrad Hinsen
Centre de Biophysique Moléculaire, CNRS Orléans
Synchrotron Soleil - Division Expériences
Saint Aubin - BP 48
91192 Gif sur Yvette Cedex, France
Tel. +33-1 69 35 97 15
E-Mail: hinsen at cnrs-orleans.fr
---------------------------------------------------------------------
More information about the mmtk
mailing list