dbTalk Databases Forums  

Possible memory leak [attn: Mosha]

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss Possible memory leak [attn: Mosha] in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Tony Proctor
 
Posts: n/a

Default Possible memory leak [attn: Mosha] - 01-19-2004 , 12:02 PM






We're running a VB6 component via ASP pages, under IIS 5.0, and this makes
heavy use of Analysis Services via ADOMD. Memory usage appears to be growing
steadily until performance gets so bad as to be unusable, or something
breaks. [PS, we can confirm that we're correctly using the Session context,
and that we are successfully utilising multiple threads]

By using HeapWalk we found that the leakage is occurring in the main process
heap. By adding code to watch when new packets appeared, we found that
hundreds of small (e.g. 16 to 64 byte) packets were appearing in the main
heap when we used ADOMD, and these were being retained. By dumping the
contents of these packets we found the vast majority were plain BSTR string
packets, and that these contained symbol names -- almost as though we'd
found the entries in a dictionary or symbol table. Some of the names I
didn't recognise (e.g. _B_str_LCase), but many were very familiar (e.g.
FormatNumber, IsError, MsgBox, Tan, Join).

We recently found a reply by Mosha to a very similar post
(http://www.sqljunkies.com/Newsgroups....sqlserver.ola
p/2003/11/21/ff47b747-ce0b-4256-ad96-29db9902d3d5.aspx). Although we haven't
tried the REFRESH CUBE technique described there, we have already tried
adding code to periodically close the OLAP connection -- surely that should
flush any cache too(?).

Could anyone confirm whether what we've observed is normal behaviour, or
whether it needs investigating and reporting?

Tony Proctor



Reply With Quote
  #2  
Old   
Tony Proctor
 
Posts: n/a

Default Re: Possible memory leak [attn: Mosha] - 01-20-2004 , 05:31 AM






It's looking more-and-more like this might be a VB 'Retain In Memory' issue.
As well as losing memory due to some symbol table being re-created, we also
leaking semaphore handles badly.

A related thread is already open in an IIS newsgroup:
http://groups.google.ie/groups?as_q=....iis&lr=&hl=en

Tony Proctor

"Tony Proctor" <tony_proctor (AT) aimtechnology_NOSPAM (DOT) com> wrote

Quote:
We're running a VB6 component via ASP pages, under IIS 5.0, and this makes
heavy use of Analysis Services via ADOMD. Memory usage appears to be
growing
steadily until performance gets so bad as to be unusable, or something
breaks. [PS, we can confirm that we're correctly using the Session
context,
and that we are successfully utilising multiple threads]

By using HeapWalk we found that the leakage is occurring in the main
process
heap. By adding code to watch when new packets appeared, we found that
hundreds of small (e.g. 16 to 64 byte) packets were appearing in the main
heap when we used ADOMD, and these were being retained. By dumping the
contents of these packets we found the vast majority were plain BSTR
string
packets, and that these contained symbol names -- almost as though we'd
found the entries in a dictionary or symbol table. Some of the names I
didn't recognise (e.g. _B_str_LCase), but many were very familiar (e.g.
FormatNumber, IsError, MsgBox, Tan, Join).

We recently found a reply by Mosha to a very similar post

(http://www.sqljunkies.com/Newsgroups....sqlserver.ola
p/2003/11/21/ff47b747-ce0b-4256-ad96-29db9902d3d5.aspx). Although we
haven't
tried the REFRESH CUBE technique described there, we have already tried
adding code to periodically close the OLAP connection -- surely that
should
flush any cache too(?).

Could anyone confirm whether what we've observed is normal behaviour, or
whether it needs investigating and reporting?

Tony Proctor





Reply With Quote
  #3  
Old   
Tony Proctor
 
Posts: n/a

Default Re: Possible memory leak [attn: Mosha] - 01-21-2004 , 10:26 AM



Well, we've eliminated 'Retain In Memory' as a possibility.

I can now confirm that a simple VB6 statement such as:

oCellset.Open sMDX, sConnection

is consuming about 8k of memory, spread across about 190 memory packets,
most of which are BSTR packets holding the symbol names of VBA members (e.g.
"IsError"). This memory is not being returned when the cellset is closed and
deallocated.

I can also confirm that it is reproducible outside of IIS, and so the Retain
In Memory should be relevant.

Tony Proctor

"Tony Proctor" <tony_proctor (AT) aimtechnology_NOSPAM (DOT) com> wrote

Quote:
It's looking more-and-more like this might be a VB 'Retain In Memory'
issue.
As well as losing memory due to some symbol table being re-created, we
also
leaking semaphore handles badly.

A related thread is already open in an IIS newsgroup:

http://groups.google.ie/groups?as_q=....iis&lr=&hl=en

Tony Proctor

"Tony Proctor" <tony_proctor (AT) aimtechnology_NOSPAM (DOT) com> wrote in message
news:#BAUmYr3DHA.632 (AT) TK2MSFTNGP12 (DOT) phx.gbl...
We're running a VB6 component via ASP pages, under IIS 5.0, and this
makes
heavy use of Analysis Services via ADOMD. Memory usage appears to be
growing
steadily until performance gets so bad as to be unusable, or something
breaks. [PS, we can confirm that we're correctly using the Session
context,
and that we are successfully utilising multiple threads]

By using HeapWalk we found that the leakage is occurring in the main
process
heap. By adding code to watch when new packets appeared, we found that
hundreds of small (e.g. 16 to 64 byte) packets were appearing in the
main
heap when we used ADOMD, and these were being retained. By dumping the
contents of these packets we found the vast majority were plain BSTR
string
packets, and that these contained symbol names -- almost as though we'd
found the entries in a dictionary or symbol table. Some of the names I
didn't recognise (e.g. _B_str_LCase), but many were very familiar (e.g.
FormatNumber, IsError, MsgBox, Tan, Join).

We recently found a reply by Mosha to a very similar post


(http://www.sqljunkies.com/Newsgroups....sqlserver.ola
p/2003/11/21/ff47b747-ce0b-4256-ad96-29db9902d3d5.aspx). Although we
haven't
tried the REFRESH CUBE technique described there, we have already tried
adding code to periodically close the OLAP connection -- surely that
should
flush any cache too(?).

Could anyone confirm whether what we've observed is normal behaviour, or
whether it needs investigating and reporting?

Tony Proctor







Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.