NeuralJack Posted September 8, 2006 Posted September 8, 2006 Is there a good place to find out approximately how much memory/system resources one control uses verses another control? I have many buttons on this project. I like the way the buttons look the best in toolbar form. I'm wondering what 20 toolbars with 3-4 buttons each would cost me resource wise verses 60-80 separate (non-toolbared) buttons. Quote Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
Nate Bross Posted September 9, 2006 Posted September 9, 2006 What I'd do, is run your exe without all of these buttons on it. Go to the Task Manager and view the memory usage of your application, then do it with the buttons in toolbars and check memory usage, and then with just the buttons. See which uses least resources. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
NeuralJack Posted September 9, 2006 Author Posted September 9, 2006 thanks nate, thats what i'll do What I'd do' date=' is run your exe without all of these buttons on it. Go to the Task Manager and view the memory usage of your application, then do it with the buttons in toolbars and check memory usage, and then with just the buttons. See which uses least resources.[/quote'] Quote Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
Nate Bross Posted September 9, 2006 Posted September 9, 2006 There is probably a better way that I don't know about, but that is how I do it. Quote ~Nate� ___________________________________________ Please use the [vb]/[cs] tags on posted code. Please post solutions you find somewhere else. Follow me on Twitter here.
Leaders snarfblam Posted September 9, 2006 Leaders Posted September 9, 2006 If you do a test like that, be sure to run the test many times under different circumstances. The reason I say so is that there are many factors that cause a program's memory usage to fluctuate. Things such as the fact that the garbage collector in the CLR won't collect the same objects at the same times, and that memory allocation won't be exactly the same when the state of the rest of the computer's memory isn't exactly the same. You'll notice that the memory usage of a program with a single form will drop dramatically (by an order of magnitude) when the form is minimized, and suppose that you open the task manager to view memory usage of method A, then close method A and run method B, and this time unwittingly minimize the window to view the already-open task manager. It would certainly seem as though method B consumes one eighth of the memory as method A, which is obviously not the case. If the difference is pronounced in all circumstances, I would say the statistics speak for themselves, but generally things such as the order that the programs are run in or even slightly varying contexts under which a program is running can make a difference. Minimize those unforeseen variables. Besides all that, I can venture a guess about which of the two will consume more resources, but a guess is all I can offer. Using only button-buttons, each button will require more Windows resources: each needs their own window, their own device context, yadda yadda yadda, whereas each toolbar-button requires more managed resources. Based on the assumption that the windows resources would out-weight the managed resources, I would say that button-buttons would use more memory than toolbar-buttons. Again, that's just a guess. Quote [sIGPIC]e[/sIGPIC]
NeuralJack Posted September 10, 2006 Author Posted September 10, 2006 Thanks guys, this is good info. Quote Currently Using: Visual Basic.Net 2005, .Net Framework 2.0
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.