[Memory Leaks]
yes the server is a win2003 biprocessor and I have installed the
framework 1.1sp1 and I have my directive <gcServer
enabled="true" /> in the application cofiguration file.
The first thing you want to do is turn that off. The gargage collection and
heap management algorithms are very different between the server and
workstation CLR, and that's only serving to confuse the issue at this point.
You want to use the same runtime on your XP workstation and your 2003 Server
so that you get the same behavior on both machines.
There are lots of resources on this available on the web. Here's a very
consice one...
http://blogs.msdn.com/clyon/archive/2004/09/08/226981.aspx
I have made a profiling and it seems the Gen 2 heap size and are
growing progressively.
This means that you're leaking memory. This isn't a garbage collection bug,
or a Large Object Heap bug, but a programming bug on your part. This is good
news, as it means you can fix the problem.
Go and download the SciTech Memory profiler and learn how to use it. Once
your comfortable with the tool, and have fixed the obvious low hanging
fruit, you're going to want to run your app for an hour, collect a heap
snapshot, let it run for a few more hours, and collect another heap
snapshot. Save this to a file somewhere, and spend the next 2 or 3 days
figuring out what's being leaked.
It will take you a full day or two just to learn how to interpret the data
given to you by the tool. This first thing you'll want to do is make sure
Dispose Tracking is turned on, get the report of "Should have been disposed
but wasn't" and fix these - hopefully fixing tje, will probably be pretty
quick. Then Lather, Rinse, Repeat.
With the GC.Collect I have solved my problem cause I can see the memory
is released after the execution of the "hard work".
It's really not. It's looking like fix, but it really hasn't solved the
problem at all. Trust me, I've been down this path before.
I don't think the garbage collector is a good guy (I am talking about
framework 1.1) cause I have read nearly 100 post in different
newsgroups and many people have the same problems when dealing
with datasets or binary objects.
Yea, well, don't believe everything what you read on the internet. People
become frustrated and confused when lacking the GC Gnosis.... and often find
a good scapegoat in the Garbage Collector. They're no more right than the
Greeks who believed Thunder was caused by the gods.
The Garbage Collector isn't the problem here. It doesn't have a bug. You
have legit memory leaks in your app.
I don't understand why on my WinXp everything works great and on a
server like that I do have to worry about those stuff?
Your problem is that you read a post somewhere that said to use the line:
<gcServer enabled="true" />
so that your application will run better. You did this without taking the
time to understand what this means - and it has changed the way your
application behaves in such a way at to expose your memory management bugs
much more quickly.
You're using the Server CLR on the server, and the workstation CLR on your
workstation. They are very different. You can go read all about it on MSDN.
There's nothing wrong with the server CLR GC Algorithms - they're not buggy
either. It's just that the way they work makes your problem surface more
quickly, as they split the manged heaps up across processors.
Are there any differences if I install my windows services in DEBUG or
RELEASE?
At this point in time? Not really. You need to fix the memory leaks, and
they're going to exist in both Debug and Release mode.