Hello,
I have a memory problem when added records to a table.
The situation is like this (simplyfied) :
query << "select id, symbol from " << STOCKS_TABLE_NAME << std::ends;
std::vector<vse_symbol_id> symbols;
query.storein(symbols);
std::vector<vse_symbol_id>::iterator I;
for(I = symbols.begin(); I != symbols.end(); I++) {
query.reset();
query << "select max(date_time) from " << HISTORY_TABLE_NAME <<
" where symbol_id='" << I->id << "'";
Result result = query.store();
query << "insert into " << HISTORY_TABLE_NAME <<
" values(%0, %1, %2, %3, %4, %5, %6)";
/** let query object know this is a template and not a normal query */
query.parse();
(for loop that will insert 2000 records each time)
for(.....) {
/** get date */
....
/* perform query */
query.execute(nr, Date.str(), Op, Hi, Lo, Cl, Vo);
The problem is in the above line I think. If I comment it out the memory
usage doesn't explode.
I get around 1.5MB more mem usage each time I insert 2000 records.
I have no clue what might go wrong here.
}
}
After 10 times adding 2000records I have a memory usage of like 30MB. Are
there any memory leaks involved in using the query object? Am I doing
something wrong?
Thanks for any help!
Elm
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php