Some advice from a .NET expert

We have a software company developing a client for us. The first version of this was server based and created a major issue for us and forced us to roll back. We then asked for a client-side version, but for obvious reasons we are a little nervous in releasing this, making sure enough testing takes place.

The software has been developed in .NET. One of our queries is over the amount of memory used, it can be anywhere up to 125MB used (more than anything else on the client), even when the client is not being used. I understand that this is to speed up the launching of the app, but my concern is the memory used locks at a varying amount each time application goes to an idol state and stays at the level until re launched. Is this normal? We asked the developer and the response was:

the reason that the memory usage is a little random when the IC viewer is closed is because we use a .NET method to dispose of the memory rather than explicitly specifying disposing of objects of when they are no longer required.  This method will check for objects that are not being used at specific points and they will be disposed of accordingly.

Disposing of objects individually is more resource intensive and so re-coding the IC to operate in this way will more than likely have a negative effect on the performance

I appreciate this may be much ado about nothing, due to my lack of understanding, but I just want to make sure this version doesn't have any memory leaks or similar that could cause us more issues. Is there anything specific to ask them or things I should be looking for?

Many thanks.
IM&T SRFTAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Mike TomlinsonMiddle School Assistant TeacherCommented:
One key thing to look at is whether that memory is fully released back to the system when the app is completely CLOSED.  If it is all released when closed, then you do NOT have a memory leak.

With respect to garbage collection, .Net is notoriously greedy and slow.  It is not unheard of for even "simple" apps to balloon up to ridiculous amounts of memory and then keep it even when the app is idle.  If all that memory is released when closed, though, then this is considered normal operation.  The .Net run-time is supposed to be smart enough to release some of the extra memory it is holding if the operating system as a whole gets low and needs some.

Concerning "disposing of objects individually is more resource intensive", that can be true under certain conditions.  Garbage collection is a slow and expensive operation, and forcing the garbage collector to run at the wrong times (such as from within a large loop) can have a serious negative impact on performance.  The garbage collector executes at an indeterminate time, you don't need to worry about it running, but you also never know when it is actually going to run.

Efficiency, however, is a completely different story.  It may be the case that the code is using more memory than necessary due to a poor design, but we can't know that without seeing the entirety of the code.  Again, though, the app may be perfectly fine and you are simply seeing the results of how the .Net run-time works.

Bottom line is the end-user, or a non-programmer, can't know if the application is efficient or not.  They only see a large footprint and think the worst is occurring.  This is a common issue ranted about on EE and the only acceptable answer is, "don't worry about it".  If you trust the developer then this is something you'll just have to deal with and educate the end-user about.  =\
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
wasiftoorCommented:
While i agree with Idle_Mind's perspective of the problem, there are incidents where the situation gets completely out of hand. In those cases code reviews are the only option. Blind Code Reviews are often very time consuming and can lead to dead ends. A more appropriate approach is to use a memory profiler like http://memprofiler.com/

These tools help your take regular snapshots of the applications memory consumption while you use the application and helps with the analysis. This can help identify problem areas. In web applications specifically, developers often forget to kill session variables. which can be a big memory hog.

Good Luck!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.