Re: 100% CPU usage to do nothing.
- From: "Kevin Frevert" <kevin@xxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 18 Dec 2007 12:36:39 -0600
The code you posted could spike the CPU to 100% if the result set is large
enough.
You could limit the result set (return fewer records) and/or try wrapping
the while loop in a DisableControls/EnableControls
TblSql.DisableControls():
try
{your while loop}
finally
TblSql.EnableControls();
end;
Good luck,
krf
"Donald S. Bossen" <sbossen@xxxxxxxxxxxxxxx> wrote in message
news:4767f2a1@xxxxxxxxxxxxxxxxxxxxxxxxx
Using Delphi6 and ADOData Set and connection componetes.
In this application I am selecting a large amount of data from a Microsoft
SQL2005 and noted it running slow the CPU was at 100% and the process was
slowing with time. So I commented all out as to have this
TblSql.First
while not TblSql.Eof do
begin
TblSql.next;
end;
and it takes the same length of time with 100% usage. Any Ideas on what is
wrong and how to fix.
Thanks
Donald S. Bossen
J&B Importers Inc.
.
- References:
- 100% CPU usage to do nothing.
- From: Donald S. Bossen
- 100% CPU usage to do nothing.
- Prev by Date: 100% CPU usage to do nothing.
- Next by Date: Re: 100% CPU usage to do nothing.
- Previous by thread: 100% CPU usage to do nothing.
- Next by thread: Re: 100% CPU usage to do nothing.
- Index(es):
Relevant Pages
|