Overview
Features
Download
Documentation
Community
Add-Ons & Services

Memory Leak >> SQLite

Please post support and help requests here.

Memory Leak >> SQLite

Postby davidpmp » 14 Nov 2009, 14:23

Hello,

how can Solve this problem ?

Session session(Poco::Data::SQLite::Connector::KEY, std::string(CStringA(m_startupPath)));

std::string word;
int number = 101;

Statement stmt = (session << "SELECT X FROM Y WHERE Z = :ln", into(number), use(word), now);

session.close();


Image

it's latest version of POCO.

thanks in advance,
Best Regards,
davidpmp
 
Posts: 8
Joined: 21 Feb 2009, 15:34

Re: Memory Leak >> SQLite

Postby alex » 14 Nov 2009, 16:05

davidpmp wrote:how can Solve this problem ?

I'm not quite sure what the problem is. I see nothing wrong with the code you are showing. As for all those new's, I can't tell how they relate to the code you are quoting. Anyway, if you want to drill down to the bottom of it, wrap your code in curly braces and see what you have left over after the scope expires:

Code: Select all
#include <crtdbg.h>
_CrtMemState s1, s2, s3;
_CrtMemCheckpoint( &s1 );
{
  Session session(Poco::Data::SQLite::Connector::KEY, std::string(CStringA(m_startupPath)));
  std::string word;
  int number = 101;
  Statement stmt = (session << "SELECT X FROM Y WHERE Z = :ln", into(number), use(word), now);
}
_CrtMemCheckpoint( &s2 );
if ( _CrtMemDifference( &s3, &s1, &s2) ) _CrtMemDumpStatistics( &s3 );

Let us know the result.
alex
 
Posts: 1116
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Memory Leak >> SQLite

Postby davidpmp » 15 Nov 2009, 19:13

Hi,

following lines allocated memory. I asked for upgrade SQLite in my previous topic and I upgraded to 3.6.19. allocated memory dont freed. How can I do it ?!?

Image



Thanks,
Best Regards
davidpmp
 
Posts: 8
Joined: 21 Feb 2009, 15:34

Re: Memory Leak >> SQLite

Postby davidpmp » 15 Nov 2009, 20:06

alex wrote:
davidpmp wrote:how can Solve this problem ?

I'm not quite sure what the problem is. I see nothing wrong with the code you are showing. As for all those new's, I can't tell how they relate to the code you are quoting. Anyway, if you want to drill down to the bottom of it, wrap your code in curly braces and see what you have left over after the scope expires:

Code: Select all
#include <crtdbg.h>
_CrtMemState s1, s2, s3;
_CrtMemCheckpoint( &s1 );
{
  Session session(Poco::Data::SQLite::Connector::KEY, std::string(CStringA(m_startupPath)));
  std::string word;
  int number = 101;
  Statement stmt = (session << "SELECT X FROM Y WHERE Z = :ln", into(number), use(word), now);
}
_CrtMemCheckpoint( &s2 );
if ( _CrtMemDifference( &s3, &s1, &s2) ) _CrtMemDumpStatistics( &s3 );

Let us know the result.


Thanks for code, memory Leak detected by CRT
davidpmp
 
Posts: 8
Joined: 21 Feb 2009, 15:34

Re: Memory Leak >> SQLite

Postby alex » 15 Nov 2009, 21:43

davidpmp wrote:I asked for upgrade SQLite in my previous topic and I upgraded to 3.6.19. allocated memory dont freed.

1.3.6 will be released with SQLite 3.6.20. SQLite forums/mailing lists would be good places to ask for help. I'll check to see if 3.6.20 suffers from the same problem.
alex
 
Posts: 1116
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Memory Leak >> SQLite

Postby alex » 15 Nov 2009, 23:36

I checked the 1.3.6 branch and could not reproduce the problem. I have wrapped the windows leak detection API into a small LeakDetector class. Code is in the sandbox, rev. 1282.
alex
 
Posts: 1116
Joined: 11 Jul 2006, 16:27
Location: United_States

Re: Memory Leak >> SQLite

Postby davidpmp » 16 Nov 2009, 13:34

Hello,

Thank you very much for your responses,

it's memory leak ?!?

CString cWord(wordSTD.c_str());


I try to extract 20 words from a table. my table column field type is text.
davidpmp
 
Posts: 8
Joined: 21 Feb 2009, 15:34

Re: Memory Leak >> SQLite

Postby davidpmp » 16 Nov 2009, 18:09

where is sqlite forums ?!?
davidpmp
 
Posts: 8
Joined: 21 Feb 2009, 15:34


Return to Support

Who is online

Users browsing this forum: No registered users and 1 guest

cron