High % of memory is consumed by unmanaged resources in .NET application

922 Views Asked by At

I have a website which executes simple MDX queries and produce output. This output is used to generate excel file. I used ANTS profiler and came to know that large amount of memory is consumed by unmanaged resources. Check the below image:

(Full size image)

What should I do next to detect such memory leaks. I want to find out why these obejcts are still alive in memory. Please suggest what should I do next.

enter image description here (Full size image)

1

There are 1 best solutions below

2
InbetweenWeekends On

I experienced a similar issue. I don't have a solution for detecting the memory leak, but I'll let you know the path I chose. Instead of calling the MDX directly from the page, I moved the MDX queries to a SQL stored procedure which returns a resultset that I can use as if it were a relational query.

CREATE procedure [dbo].[executeMdxQuery]
as
Declare @sql nvarchar(max) = '  SELECT a.* FROM OpenQuery("MY_SERVER",'' 

with member [Measures].[Fiscal Calendar Level] as ' --- remaining MDX 

exec sp_executesql @sql 
GO

Hope this helps