threads-shared - Thread memory not being released.

Posted on Wed Nov 29 07:05:36 2006 by stratimus
Thread memory not being released.

Hello all,

I have a MUD engine I'm currently writing and the basic structure at the moment is:

Main script initializes back-end connection for administation

This back-end module runs in its own thread and listens for clients to connect.

Upon connection, a new object is made with the Client class which takes commands from the client.

I have an object that is shared across all modules and threads that holds information about the server (uptime, clients connected, etc). While the in_motion method returns true, these things such as the back end and client threads keep doing their thing. The problem is that when a client leaves its memory is not erased. I'm suspecting that it's because of this object shared with everything, but the problem is that I need it to be shared so threads/modules know what's going on. Does anyone have any suggestions on a better way of doing it or a method of getting the memory released? Usually it's not a big deal but this is a server that's meant to run 24/7 and when each client takes 2MB it builds quickly.

Thanks.

Direct Responses: 3661 | Write a response