Memory usage anomaly with server application

J

jack

I am having a strange memory issue in my server application. This
application accepts socket connections, passes messages around, then
closes them.

Using the .NET memory profiler from scitech.com, it reports reasonable
memory behavior, hovering around 400k for live bytes, and peaking no
higher than 1.5megs or so for total bytes used.

However, looking in the task manager at the process, it reports the
memory being used at around 50megs, climbing about 1 meg every second.
It will get as high as 700megs+!!

Are there some known memory leaks in .net?
Could I be doing something wrong in my C# code to cause this?
 
J

jack

Unfortuantely I can't post the code, I'm not sure it would be very
feasible anyway, it isn't small, and I have no idea which piece might
be the problem.

did get some more info from this profiling too. It seems to be that
the native memory growth is occuring in what the profiler calls "holes"



private-->managed heap-->normal heap-->generation #2--->"holes"


according to the proflier holes are:


"Holes" represent memory that is unused between two allocated
instances. "Holes" appear when the heap is not fully compacted, due
to pinned instances or optimizations in the garbage collector.


anyone have any idea what it is talking about? what is a pinned
instance?
 
W

Willy Denoyette [MVP]

jack said:
Unfortuantely I can't post the code, I'm not sure it would be very
feasible anyway, it isn't small, and I have no idea which piece might
be the problem.

did get some more info from this profiling too. It seems to be that
the native memory growth is occuring in what the profiler calls "holes"



private-->managed heap-->normal heap-->generation #2--->"holes"


according to the proflier holes are:


"Holes" represent memory that is unused between two allocated
instances. "Holes" appear when the heap is not fully compacted, due
to pinned instances or optimizations in the garbage collector.


anyone have any idea what it is talking about? what is a pinned
instance?

Please see the general NG where I replied to the same Q, and don't
multipost.

Willy.
 
L

Landi

First, I am assuming that your app is a multi threaded application, right?
Second, does your machine have Hyper Threading? Is that enabled?

If that's the case then that's your problem. In HT enabled machines these
threads don't get recycled properly.
We are having the same issue with our app and when we disabled HT then the
problem goes away. As of right now we don't have a solution to this. When we
do I will post back the answer. BTW, we are doing messaging too.
See if that does the trick.
 
L

Landi

Also, do netstat -a and take a look at that. Does that show up any of your
threads sticking around?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top