Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / CLR / November 2003

Tip: Looking for answers? Try searching our database.

CLR Heap Question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David Miller - 07 Nov 2003 16:38 GMT
Hello,

I am experiencing a problem with an MDI app that I have written in Visual
Basic.Net using the 1.1 version of the Framework. The application "leaks"
memory. It appears that, over time, as more and more forms are opened and
closed, references to some object are not getting cleaned up in the app
(these resources are released when the app is closed, however). When I run
the "CLR Memory - Bytes in All Heaps" performance counter in the Performance
Monitor, garbage collections can be seen, but over a long period of time the
heap size grows without bound.

In order to show this behavior, I put a timer in my MDI application that
simply opens and closes a form every few seconds. Then I would start this
test app on various machines and monitor it over about a 12-hour period. The
strange thing about the results, however, is that they seem to show
different behaviors between Windows XP and Windows 2000 machines. When the
test is run on a Windows 2000 machine, the CLR heap size seems to stay
constant. When it runs on an XP machine, the CLR grows without bounds.

So I guess my questions are as follows...
Does anyone have any suggestions as to what might be causing this? What kind
of things should I be looking for in my app that would cause this? Is there
any reason that the app would be behaving differently under the two
different operating systems?  Has anyone had a similar problem, and if so,
what is the best way to debug a "resource leak" like this?

Any help would be greatly appreciated.

Thank you,
David Miller
Sebastien Lambla - 10 Nov 2003 12:31 GMT
Are you using Master - Details views? There is an alleged memory leak in
some cases, although I cannot find the blog entry I got it from...

Other potential memory leaks:
1. Compiled XSL-T templates using javascript
2. Compiled Regular Expressions
3. Emitted code

All these are loaded in memory and never collected.

Signature

Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/

> Hello,
>
[quoted text clipped - 26 lines]
> Thank you,
> David Miller
David Miller - 10 Nov 2003 14:51 GMT
Thanks for your suggestions, Sebastien.

No, I am not using Master-Details view. I am not using XSLT templates,
regular expressions or emitted code, either. I am however, using some third
party presentation layer controls from SyncFusion. I strongly suspect that
they are the source of the problem, but they are so prevalent throughout the
app that removing them would essentially require me to rewrite the whole
appliation.

It still bothers me to no end that they would work just fine on 2000, but
not on XP.

> Are you using Master - Details views? There is an alleged memory leak in
> some cases, although I cannot find the blog entry I got it from...
[quoted text clipped - 41 lines]
> > Thank you,
> > David Miller
Sebastien Lambla - 11 Nov 2003 12:03 GMT
Did you try doing a Memory Profile using the CLR Profiler (version 2 is just
just out of the door) ? Using this you should see if the toolkit you're
using is leaking. If it's based on some COM interop, you can further used
fxCop to test for known weaknesses in COM interop development...

Signature

Sebastien Lambla
http://thetechnologist.is-a-geek.com/blog/

> Thanks for your suggestions, Sebastien.
>
[quoted text clipped - 60 lines]
> > > Thank you,
> > > David Miller
David Miller - 11 Nov 2003 16:22 GMT
No, I haven't tried that yet. I will though. Thanks.

> Did you try doing a Memory Profile using the CLR Profiler (version 2 is just
> just out of the door) ? Using this you should see if the toolkit you're
[quoted text clipped - 74 lines]
> > > > Thank you,
> > > > David Miller

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.