Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ SQL » [BUG] Memory leak in MySql package
Re: [BUG] Memory leak in MySql package [message #39981 is a reply to message #39925] Wed, 22 May 2013 09:41 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14266
Registered: November 2005
Ultimate Member
klugier wrote on Sat, 11 May 2013 11:19

Hello Mirek,

I sorry, I have sent wrong header file. Of course, we need to add "counter" code to constructor and destructor.

MySqlSession()       { numberOfInstances++; mysql = NULL; Dialect(MY_SQL); }
~MySqlSession()      { numberOfInstances--; Close(); }


I would like to relate to putting EXITBLOCK. In my option counter method is more efficient, because memory can be free at runtime. On the other hand, EXITBLOCK will make order when the program ends. Of course, I can be wrong what EXITBLOCK is doing. I have never used it in my applications.



Well, I think that amount of memory is not high and there is plausible usage scenario where you create DB connection per request - in that case MySql will have to recreate the whole memory area....

Frankly, more I am thinking about this, perhaps the best course of action is to do nothing. This is a 'leak' we can afford.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Reason why session does not connect
Next Topic: Sql(SqlSession& session) problem
Goto Forum:
  


Current Time: Fri Jul 18 06:39:49 CEST 2025

Total time taken to generate the page: 0.03662 seconds