• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 188
  • Last Modified:

Font and Color Dialogs intermittently take an exceptionally long time to display on certain user machines. Any idea why? I cannot reproduce locally.

I have a charting application that has many users.  Why viewing a chart, they can right-click and choose the preferences option to launch another form that is shown modally to modify the parameters of the chart.  On this new form there are many buttons for modifying the colors and fonts of the chart.  When they click on one of these buttons, I simply show a Color(or Font) Dialog with simple code:

ColorDialog dlg  = new ColorDialog();
dlg.Color = (Some Default Color);
dlg.ShowDialog();
Color result = dlg.Color;

A user called this morning and said it was taking between 6-10 minutes for the dialogs to reveal themselves.  The moment he clicked the button to launch the above code he was no longer able to touch any of the charts, receiving a beep in complaint, as though the Color dialog was visible (shown modally).  He simply had to wait it out and respond to the dialog.  He also said he received similar delays with the Font dialog.  Again, it is only 'some' users and only 'some' times.  This user does not always experience this issue.

Any ideas would be helpful, I dont see anything I can change.


**UPDATE**

The same user has informed me that even MessageBox dialogs are taking extended amounts of time to display.

**END UPDATE**
-Eric
0
ericdotnet
Asked:
ericdotnet
  • 3
  • 2
1 Solution
 
petoskey-001Commented:
It sounds like the disk is thrashing.  On computers with not enough ram, windows will swap out the currently running memory to the hard drive and then bring it back from the hard drive to real memory.  It does this transparently so programs don't notice, but users sure do.  I would suggest your client buy more ram.

As far as your code, it's late so I can't think right now what you would check.  
0
 
petoskey-001Commented:
oh Yeah, is it limited to just your program?  My guess is it happens to most programs of similar size, or when running several applications on his computer.
0
 
ericdotnetAuthor Commented:
It is just my program, but the program _does_ take huge amounts of ram - half a gig or so (it pulls market data from many financial exchanges).  I'll have him upgrade his ram and see if that resolves it.
0
 
ericdotnetAuthor Commented:
petoskey-001, you had it right.  It turns out that GDI+ objects are not truly managed objects and they need to be explicitely disposed of.  I was not doing this and they were eating up all of the systems ram and filling up the page files, hence the slow dialogs.  Thanks for helping me find the bug! :)
0
 
petoskey-001Commented:
Ah, The wonders of C#.  It's a nice language, but to do anything low level or you end up falling back on your C skills.  Glad to hear you found the problem.  
0
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.

Join & Write a Comment

Featured Post

Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now