Link to home
Start Free TrialLog in
Avatar of fahimnxb
fahimnxb

asked on

Memory Utilization Problem in .NET

Dear Experts,

According to .net documentation, Garbage Collector should free the memory. we analysed and found following things.

1- We have 40 modules in window desktop application in VB.net. Every module opening adds 1 or 2 MB to Memory utilization statistics displayed in Task Manager. Now see, a user was engaged in public sector dealing. He has to open forms 100 times a day and has to perform different tasks. Continuous addition to memory causes application to become slower. User has to shutdown Application and then restarts if he needs to free Memory which is not acceptable.  

Please Advice...we have tried to destroy objects explicitly and we have call system.GC.Collect also with that.......but no improvement

Regards,
Fahim
ASKER CERTIFIED SOLUTION
Avatar of prakash_prk
prakash_prk
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
http://www.scitech.se/memprofiler/Default.htm

Try this memory profiles to find the leaks, unremoved instanes .

Regards
Prakash

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of fahimnxb
fahimnxb

ASKER

Ya data loaded in memory is too large, after destroying all objects , data sets adapter etc. And also calling
GC.Collect()
GC.WaitForPendingFinalizers()
memory is not recovered.

Eg
used memory before execution 100Mb
used memory after execution 450Mb
used memory after destroying all objects 350MB

dats the story.

Regards,
me


can you say which types of objects you have in your project ?

full objects list ?
That's really not a problem.

GC.Collect is like cleaning your house.  It moves everything to the proper place, but it doesn't make your house smaller.
To get your house smaller, .NET will release some of your application's memory when the system becomes memory constrained.  But it there's plenty of memory, it will leave your house (your application) large.
But something is not good, since this is causing the application become slow.
Exactly application is getting slow and GC.Collect is not collecting memory properly.

Objects are DataAdapter, SqlConnection, DataSet etc.


Regards,
Me
What version of visual studio are you using?

are you closing the connections when the forms are being closed or disposed?

how many forms do you have in your application?

have you noticed if an specific form that is causing the problem or all the forms cause the problem?