Question

Guys I have developed a ticket management system in C# windows forms application. Now this is the first time I have developed any application that might be used in real world (my school may implement it).

As my school is not that rich and mostly run by charity, so the technology they use is pretty old (Pentium 4 pcs with windows XP having maximum of 1 gb RAM), so I need to make my application as light-weight as possible i.e. it should not be resource hungry. (I have developed this app on dual core laptop with 4 gb RAM, and I haven't come up with any errors yet regarding to resources but considering the low config of target PC(s) I want to be sure)

I have about 25 forms in my application, in which 7-8 have DataGridViews in them. Others are just filled with labels and textboxes for taking input or display data - nothing fancy.

As this is my first complete application I am not sure how it will perform in the performance department. I read somewhere that in .Net applications you have to call dispose() method whenever the form is closer or else the garbage wont be collected and same goes for DataGridView. Is that true? because throughout the application I haven't used Dispose anywhere. Should I be worried?

If Dispose() is necessary, where and when should I call it? on FormClosed event? If a form has DataGridView should I dispose it first and then dispose form or is directly disposing the form enough? Also if you "experienced programmers" could point out some good practices to make application less resource dependent and less crash-prone then that would be great.

Was it helpful?

Solution

As far as I'm aware C# (and .NET) is managed. So your code and objects will get disposed of.

A good trick, is to look at using Using blocks. These are especially useful around data connections.

The other obvious piece of advise is to actually run it on the machines you will be using it and, and see how it performs.

Hope this helps.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top