List:MySQL++« Previous MessageNext Message »
From:weidong shen Date:December 16 2008 7:06am
Subject:Re: memory will increase all the time in a simple example
View as plain text  
Thanks for your response:)

I changed the code as below. The result is as same as before.  The memory
will be consumpted 4k per 1~2 second.
       mysqlpp::sql_int id = 0;
        while (1) {
            Query query = con.query();
            query  << "SELECT  COUNT(*) FROM dp_npc;";
            StoreQueryResult res = query.store();
            mysqlpp::Row &obRow = res[0];
            cout << obRow[0];                         // the memory is
statble.
            id = obRow[0];   // the memory will be increasing all the time
when to execute this instruction.

            for (int i = 1; query.more_results(); ++i) {
                res = query.store_next();
            }
            Sleep(10);
        }

2008/12/16 Mickaël Wolff <mickael.wolff@stripped>

> weidong shen a écrit :
>
>>           mysqlpp::sql_int id = obRow[0];   // the memory will be
>> increasing all the time when to execute this instruction.
>>
>>
>  You create a variable on the stack, your memory consumption must increase
> ;)
>  Joke apart, how huge does your memory consumption grow ?
>
> --
> Mickaël Wolff aka Lupus Michaelis
> http://lupusmic.org
>
>
> --
> MySQL++ Mailing List
> For list archives: http://lists.mysql.com/plusplus
> To unsubscribe:
> http://lists.mysql.com/plusplus?unsub=1
>
>

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