Memory Leak calling static method

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

We are calling a static method in a class part of the project. This is C#.
If we pass variables we see a constant growth in memory that does not seem
to stop.
If we do not pass variables, the memory usage does not grow.

We understand GC is supposed to take care of releasing memory, but we
started to go over 300,000,000 and decided this was not OK.

Any thoughts/help is appreciated.
 
Doug said:
We are calling a static method in a class part of the project. This is C#.
If we pass variables we see a constant growth in memory that does not seem
to stop.
If we do not pass variables, the memory usage does not grow.

We understand GC is supposed to take care of releasing memory, but we
started to go over 300,000,000 and decided this was not OK.

Any thoughts/help is appreciated.

Could you post a short but complete program which demonstrates the
problem?

See http://www.pobox.com/~skeet/csharp/complete.html for details of
what I mean by that.
 
We are calling a static method in a class part of the project. This is C#.
If we pass variables we see a constant growth in memory that does not seem
to stop.
If we do not pass variables, the memory usage does not grow.

Please show us relevant parts of your code. Or use a profiler to learn
what type of objects are causing the increase in memory use.



Mattias
 
My initial guess would be that it has nothing to do with the empty
static method. If there truly is a problem, it is probably in the
implementation of aMessage.ToString().
 
Back
Top