Garbage collection

S

Simon Pickles

Hi,

I'm building a server with python, but coming from a c++ background,
garbage collection seems strange.

For instance, I have a manager looking after many objects in a dict.
When those objects are no longer needed, I use del manager[objectid],
hoping to force the garbage collector to perform the delete.

However, this doesn't trigger my overloaded __del__ destructor. Can I
simply rely on the python garbage collector to take it from here?

Is there a way to find how many references exist for an object?

Thanks

Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,598
Members
45,144
Latest member
KetoBaseReviews
Top