Memory usage with linked servers



I have written an OLEDB driver that acts as a linked server within SQL2000
(in process).

Now when I issue a query to retrieve data from the linked server, the
SQLServer memory usage in task manager will go up. This is fine and is what
you would expect, however, if I issue the same query again then SQLServer
memory usage goes up again and will continue to go up each time you issue
the same query.

I understand SQL dynamic memory and for SQL databases controlled by
SQLServer I can see that the server will allocate memory to bring new pages
in from disk, but bringing in the same pages won't result in more memory
being allocated - it will just use that memory.

So for linked servers, I guess that SQLServer isn't aware that it is
receiving the same information that it has already received from the
previous query and just allocates some more memory for the "new" results.

My question is "is this normal behaviour or can I somehow give SQLServer
enough information for it to determine if it has already cached the data
from the linked server in order to stop it allocating more memory".

BTW I am fairly sure that this isn't a memory leak in the OLEDB driver
..DLL - after SQLServer unloads the OLEDB driver .DLL the memory allocated to
SQLServer in task manager does not go down (despite the fact that the DLL no
longer exists in any process).

--
Best regards
Mark


.



Relevant Pages

  • Re: FTS Performance in SQL 2005
    ... Can you post you query plans and the output of statistics IO ... SQL Server MVP ... Because i've set the MAX sql-server memory to 3.5 GB instead of 4.0 GB ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: FTS Performance in SQL 2005
    ... Because i've set the MAX sql-server memory to 3.5 GB instead of 4.0 GB ... its the pipe between the CPU and Memory that could be the bottleneck. ... and that you have a covering index on the columns in the query. ... Plan window will then give you a percentage query cost relative ...
    (microsoft.public.sqlserver.fulltext)
  • Re: FTS Performance in SQL 2005
    ... Now if I do a query directly to the field I would theoretically need: ... SQL Server MVP ... Because i've set the MAX sql-server memory to 3.5 GB instead of 4.0 GB ... cost relative to the whole batch, ...
    (microsoft.public.sqlserver.fulltext)
  • Re: Possible memory leak using $sth->{NAME} ?
    ... The basic idea behind the original query was to do a complicated ... while still seeing the leak. ... After executing the query, you must do something which triggers the ... results of the query that would make a difference to the memory usage ...
    (perl.dbi.users)
  • Re: Help! Difficulty understanding DB -> Object mapping
    ... The bottleneck is getting it into memory as datasets; extracting particular information from the datasets in memory is the fast part. ... [I would add that whoever writes the subsystem needs to understand the real trade-offs, ... Most DBMS's have been able to give good performance with joins for some time, although in the past you had to have a pretty good knowledge of how the query was executed in order to achieve that performance. ... "Compiled" queries, say in stored procedures, are typically tokenized on the first invocation, and a query plan is computed based on the passed parameters for that invocation. ...
    (comp.object)