Subject RE: [ib-support] Memory Problem With Select
Author Ignace MARTIN
James,

Do you correctly frees the sqlda variable after statement as follows:

isc_attach_database
for (int n = 0; n < 2000; n++)
isc_start_transaction
isc_dsql_allocate_statement
osqlda = (XSQLDA ISC_FAR *) malloc(XSQLDA_LENGTH(n));
osqlda->sqln = n;
osqlda->version = 1;
isc_dsql_prepare
isc_dsql_describe
isc_dsql_execute
while (isc_dsql_fetch)
isc_dsql_free_statement
free(osqlda);
isc_commit_transaction
isc_detach_database



Ignace


-----Message d'origine-----
De : jamesg@... [mailto:jamesg@...]
Envoye : mercredi 24 octobre 2001 15:31
A : ib-support@yahoogroups.com
Objet : [ib-support] Memory Problem With Select


I am having difficulty with the memory usage of IBServer.exe under
Windows NT and am hoping someone can help. Bascily every time I
execute a select statement using the api functions, the memory usage
of IBServer.exe grows. Here are the specifics:

If I open the database, do a select and then close the database then
the database only grows on the first select and never grows any
larger.

If I open the database, do a bunch of selects, and then close the
database then the database grows for each select, when done in a
tight loop the database grows at an alarming rate of about 1mb per
second.

I would just go with the first method, however the code is MUCH
slower in this case. Note that a program that does a select every
couple of seconds causes IBServer.exe to grow to hundreds of
megabytes in a few hours. Note also that this does not seem to
happen with non-select statements.

Here are some examples of the way I am calling it:

This will only increase memory size a small amount:

for (int n = 0; n < 2000; n++)
isc_attach_database
isc_start_transaction
isc_dsql_allocate_statement
isc_dsql_prepare
isc_dsql_describe
isc_dsql_execute
while (isc_dsql_fetch)
isc_dsql_free_statement
isc_commit_transaction
isc_detach_database

This will increase memory size very quickly:

isc_attach_database
for (int n = 0; n < 2000; n++)
isc_start_transaction
isc_dsql_allocate_statement
isc_dsql_prepare
isc_dsql_describe
isc_dsql_execute
while (isc_dsql_fetch)
isc_dsql_free_statement
isc_commit_transaction
isc_detach_database

James



To unsubscribe from this group, send an email to:
ib-support-unsubscribe@egroups.com



Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/