Solved

Some advice from a .NET expert

Posted on 2012-04-13
2
173 Views
Last Modified: 2012-04-16
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.
0
Comment
Question by:IM&T SRFT
2 Comments
 
LVL 85

Accepted Solution

by:
Mike Tomlinson earned 350 total points
Comment Utility
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
 
LVL 9

Assisted Solution

by:wasiftoor
wasiftoor earned 150 total points
Comment Utility
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

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

Welcome my friends to the second instalment and follow-up to our Minify and Concatenate Your Scripts and Stylesheets (http://www.experts-exchange.com/Programming/Languages/.NET/ASP.NET/A_4334-Minify-and-Concatenate-Your-Scripts-and-Stylesheets.html)…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now