?
Solved

Some advice from a .NET expert

Posted on 2012-04-13
2
Medium Priority
?
202 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 86

Accepted Solution

by:
Mike Tomlinson earned 1400 total points
ID: 37842451
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 600 total points
ID: 37842738
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

New benefit for Premium Members - Upgrade now!

Ready to get started with anonymous questions today? It's easy! Learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently while returning home from work my wife (another .NET developer) was murmuring something. On further poking she said that she has been assigned a task where she has to serialize and deserialize objects and she is afraid of serialization. Wha…
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

752 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