List:MySQL++« Previous MessageNext Message »
From:Warren Young Date:December 16 2008 7:31pm
Subject:Re: memory will increase all the time in a simple example
View as plain text  
weidong shen wrote:
> Hi Warren Young:

Please send messages only to the list.  There's no value in Cc'ing my
personal account, too.

(Then I went and did the same thing in reverse.  Sigh...)

> Below is a simple example I wrote. The problem is that the memory will 
> increase all the time when executing "mysqlpp::sql_int id = obRow[0]". 
> But the memory will be stable when only executing this instruction "cout 
> << obRow[0]".

I can't reproduce it here; memory use stays stable at about 4 MB.  I
tried both the current version of MySQL++ with VC++ 2008 and 3.0.6 with
2005.  All else seems to be the same, too: MySQL 5.0.67 on XP.

I didn't use your example exactly, but instead modified MySQL++'s
examples/multiquery.cpp, replacing everything after the connect() call
with this:

         while (1) {
             Query query = con.query();
             query << "SELECT COUNT(*) FROM stock";
             StoreQueryResult res = query.store();
             mysqlpp::Row& obRow = res[0];
             cout << obRow[0] << ' ' << flush;
             mysqlpp::sql_int id = obRow[0];
             while (query.more_results()) {
                 res = query.store_next();
             }
             Sleep(10);
         }

There are some minor style differences between this and what you posted,
but I don't see that there should be any functional difference.  Try
this there.

Thread
memory will increase all the time in a simple exampleweidong shen16 Dec
  • Re: memory will increase all the time in a simple exampleweidong shen16 Dec
  • Re: memory will increase all the time in a simple exampleMickaël Wolff16 Dec
    • Re: memory will increase all the time in a simple exampleweidong shen16 Dec
      • Re: memory will increase all the time in a simple exampleMickaël Wolff16 Dec
        • Re: memory will increase all the time in a simple exampleweidong shen16 Dec
  • Re: memory will increase all the time in a simple exampleWarren Young16 Dec