memory leak when running with mysql++ or so it seems -
03-30-2006
, 12:03 PM
Hi,
I have a program which receives a packet from another application
and processes it against the DB depending on whats passed. The
structure of the program is event driven, so I have a class which
listens to the socket and puts whatever is coming to a Queue. A
callback function reads whats on the Q and processes it by dispatching
to other functions depending on the type of the message received(to
query diff DBs).
Now once the message has been dispatched to the appropriate function,
i open a connection, create a query and run select and insertion
querries and i return from the function back to the message handler
and out of that, so in this case, the connetions should automatically
disconnect and release any memory. But after running 10-15k times, i
see many connections in incorrect states and the memory usage of the
application becomes 20-30% of the system, I cant imagine that no
object is getting destroyed since they go out of scope.
What seems to be the problem here? do I have to mannually do the
cleanup, do I need to disconnect everytime? The memory usage shouldnt
increase to this level in any event, it starts from 2-3mb and goes
upto 100-150mb.
Also is there a quick way i can set connection to stay alive for
every(until the program quits).
Thanks
Ankur
--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw |