Recent

Author Topic: Growing memory and MySQL  (Read 2807 times)

Mike

  • Guest
Growing memory and MySQL
« on: April 06, 2006, 01:37:58 pm »
Hello all,

I'd like to know what I'm doing wrong (certenly I'm doing something wrong). Here is a problem described:

- I have a OnTimer event (TTimer component) defined like this:

MySQLQuery.SQL.Text := 'SELECT CVSKEY FROM CVS WHERE CVSCID=' + IntToStr(ChannelID) + ' AND CVSNBR IS NULL';
MySQLQuery.Open;
CallID := MySQLQuery.Fields[0].AsInteger;
MySQLQuery.Close;

the interval of TTimer is 2000ms. My problem is that after ex. 12 hours of working my application memory usage is very high (over 100MB). What should i free (or something) on each interval? Is there a better way to do select to db?

Thanks in advance,

Mike

Marc

  • Administrator
  • Hero Member
  • *
  • Posts: 2496
RE: Growing memory and MySQL
« Reply #1 on: April 06, 2006, 04:25:13 pm »
if you dont create a MySQLQuery each time in your timer event, this code looks valid. In that case there is a memleak in the TQuery descendent. See if you can pinpoint it with a heaptrace, or file a bugrep at the FPC site (if it aisn't already reported) (or askthe ML if there is such problem known)
//--
{$I stdsig.inc}
//-I still can't read someones mind
//-Bugs reported here will be forgotten. Use the bug tracker