?
Solved

Memory Hog - C# -  UI

Posted on 2006-07-06
4
Medium Priority
?
446 Views
Last Modified: 2008-02-01
Can someone advise, or post some good links on this topic?

1)  topics that explain why the C# UI, or the UI control toolbox items seem to be horribly memory intensive to most applications..  and how best to separate the UI from the rest of the application in a way where the UI does not effect any memory intensive calculation threads that can be occurring at same time.    I noticed in many of my Apps that run intensive calculations on realtime data ..  that the UI eventually locks-up, or hangs after a few minutes and becomes totally unresponsive in some cases...  even though it does not seem like that heavy a load for the App to handle.    Why does the UI seem "glitchy" to me?   Have had a better experience with Java controls..  it seems    ??
0
Comment
Question by:lblinc
[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
4 Comments
 
LVL 37

Accepted Solution

by:
gregoryyoung earned 1000 total points
ID: 17058042
" topics that explain why the C# UI, or the UI control toolbox items seem to be horribly memory intensive to most applications..  "

I assume you mean winforms? I have seen many fairly light weight winforms applications but I guess it really depends what you are doing. Winforms can be a bit heavy memory wise. Alot of this is changing though with 3.0. Winforms is not however your only option, you can also use a more platform independent GTK# which is based off the GTK libraries.


"and how best to separate the UI from the rest of the application in a way where the UI does not effect any memory intensive calculation threads that can be occurring at same time. I noticed in many of my Apps that run intensive calculations on realtime data ..  that the UI eventually locks-up, or hangs after a few minutes and becomes totally unresponsive in some cases...  even though it does not seem like that heavy a load for the App to handle.    Why does the UI seem "glitchy" to me?   Have had a better experience with Java controls..  it seems    ??"

Most likely because they are being used incorrectly. I would take a look at using background threads so as to keep your message pump a pumping which makes your app responsive. Remember when you need to update a control you do it on the main thread (i.e. Control.BeginInvoke()).

I would recommend reading http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms06112002.asp and http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms08162002.asp for more basic information in the regard.

Cheers,

Greg

0
 

Author Comment

by:lblinc
ID: 17058144
gregory:    thanks much for info.   if you will, let me browse the links later this afternoon, then get back to you.    in the meantime will keep this post open for a bit.
0
 
LVL 37

Expert Comment

by:gregoryyoung
ID: 17058190
Also be careful when measuring memory with .net apps .. alot of it has to do with the way garbage collection works .. if you start putting pressure on the GC it will often times be more aggressive with freeing memory = smaller working set. It works alot better when there is extra memory for it to deal with performance wise .. if the system has loits of free resources it is not afraid to use them to offer bettter runtime performance. If the system runs low it is also quick to back off some of those resources.
0
 
LVL 10

Expert Comment

by:Ready1
ID: 17276310
memory is not a problem these days its dirt cheap. its all about knowing how to program well. if you have a memory intensive calculation to perform dont do it on the UI thread so it does not block.

Regards,
Ready1
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

777 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