weidong shen a écrit :
> 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);
> }
What is Sleep ?
What OS are you running ?
What compiler ?
What version of MySQL++ ?
I tried something near your code with 3.0 version on my Debian, and
the memory consumption never grows (even I did an infite loop without
pause).
--
Mickaël Wolff aka Lupus Michaelis
http://lupusmic.org