List:MySQL++« Previous MessageNext Message »
From:Matt Dargavel Date:June 23 2006 10:45am
Subject:RE: Query Object Memory Leak?
View as plain text  
For what it's worth, I took a memory snapshot using _CrtMemCheckpoint() at
the start and the end of the test loop.  I ran 1000000 cycles of the loop
and included the test results below.  Note the extra 1000001 CRT blocks,
predictably that number is always 1 more than the number of loops.  (For
those that care I re-ran the test with a couple of loops and dumped out the
allocated CRT blocks- apparently they were allocated in xiosbase line 514).
Any way, I think the point is mysql++ isn't to blame- the memory that is
still allocated after the loop is within the CRT.

--------

0 bytes in 0 Free Blocks.
752 bytes in 32 Normal Blocks.
17261 bytes in 135 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 24431 bytes.
Total allocations: 39657 bytes.
--- starting test ---
............................................................................
..........................................................................
............................................................................
..........................................................................
............................................................................
..........................................................................
............................................................................
..........................................................................
............................................................................
..........................................................................
............................................................................
..........................................................................
............................................................................
........................
--- done test ---
0 bytes in 0 Free Blocks.
752 bytes in 32 Normal Blocks.
4021357 bytes in 1000136 CRT Blocks.
0 bytes in 0 Ignore Blocks.
0 bytes in 0 Client Blocks.
Largest number used: 4022201 bytes.
Total allocations: 96043753 bytes.


-----Original Message-----
From: Warren Young [mailto:mysqlpp@stripped] 
Sent: 23 June 2006 06:49
To: plusplus@stripped
Subject: Re: Query Object Memory Leak?

Warren Young wrote:
> I did something very similar, but mod 10,000 instead, and only got a 
> few dots before it dereferenced a null pointer.

On further investigation, it was that I was only getting one dot -- when i
== 0 -- because it was crashing on the first Query object destruction. 
  And that was because I was using a mysqlpp.dll built with VC++ 2003 with
my test program built and running under VC++ 2005.  D'oh!

Running Matt Dargavel's test program, running against a consistent set of
libraries, I also see a 66 MB heap after a million runs.  This is with the
latest repository version of MySQL++, MySQL 4.1.14, and VC++ 2005.

-- 
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe:
http://lists.mysql.com/plusplus?unsub=1

Thread
Query Object Memory Leak?Bill K21 Jun
  • Re: Query Object Memory Leak?Warren Young21 Jun
    • Re: Query Object Memory Leak?Bill K21 Jun
      • Re: Query Object Memory Leak?Warren Young21 Jun
        • Re: Query Object Memory Leak?Bill K21 Jun
          • Re: Query Object Memory Leak?Warren Young21 Jun
            • Re: Query Object Memory Leak?Bill K22 Jun
              • RE: Query Object Memory Leak?Matt Dargavel22 Jun
                • Re: Query Object Memory Leak?Bill K22 Jun
                  • Re: Query Object Memory Leak?Jim Langston22 Jun
                • Re: Query Object Memory Leak?Warren Young23 Jun
              • Re: Query Object Memory Leak?Warren Young23 Jun
                • Re: Query Object Memory Leak?Warren Young23 Jun
                  • RE: Query Object Memory Leak?Matt Dargavel23 Jun