Memory Managment/Objects lifecycle managment

  • Thread starter Thread starter LP
  • Start date Start date
L

LP

Hello .NET experts

A group of develpers here are having some arguements about different ways to
write program with minimal memory footprint.
One method in buisness class creates an instance of another class and calls
its method that does database related work. This buisness class methods is
being called in a loop, so everytime it executes it creats 1 instance of
db-related object.
Another developer sugested making db-related object a class member, rather
then local to a method, and create new instance of it in class constructor.
Considering Garbage Collection in .NET will this make any difference?
What are the best practices in general to minimize memory footprint of .NET
apps ?
Thank you so much.
 
Back
Top