Is there a way for me to get the amount of memory and processor power needed for my application. I recently had a very unpleasant experience when one of my applications kept freezing the computers on which it was working. This is obviously related to the lack of hardware power, because it works perfectly on the stronger computers that I used for testing purposes, where the application worked perfectly. So my question is - is there a way to calculate the amount of hardware power needed to run the application smoothly? Almost all of my applications are done in C#, so I would need a method that can work with that type of application. Thanks
3 Answers
This is obviously related to the lack of hardware power
This entirely depends on what your application is doing. If you are solving problems in a "not so time efficient way", then you can optimize the code.
I would suggest that you analyze your code with a profiler.
This will tell you:
- What parts of your code are taking up most RAM/CPU
- How much RAM in total did your application need when it peeked
- Information about CPU consumption

- 1
- 1

- 36,033
- 20
- 126
- 183
-
Right, but imagine that we're talking about a PC game and user has an old GPU and CPU. Sometimes profiling works good, but other situations are just what OP said: outdated hardware. – Matías Fidemraizer Jul 05 '12 at 08:12
-
@MatíasFidemraizer, By profiling you can find bottlenecks regarding memory / cpu. GPU will be harder to benchmark. – Filip Ekberg Jul 05 '12 at 08:16
-
Yeah, but your answer isn't an actual solution for the OP. Why you think it's an optimization problem? Who knows! You're assuming OP wrote an unoptimized application and his problem isn't that some customers have outdated hardware. But wait, he said that some have outdated hardware! :D – Matías Fidemraizer Jul 05 '12 at 08:33
-
The application that I had the problem with reads from an XML file certain data, does the validity check of that data, combines it with some user input (creates a record of a sort) and inserts that record into a SQL database. Also it can generate 2 kinds of reports based on the data in the database. I already started with code analysis and I think that my first "point of attack" has to be the validation algorithm, because that one is called most often. – NDraskovic Jul 05 '12 at 08:36
-
@MatíasFidemraizer, I'm not assuming anything. But profiling is the first thing you should do when your application runs slower than expected. – Filip Ekberg Jul 05 '12 at 08:42
-
I'm not agreed with you and OP. Yes, profiling can help in finding "black wholes" in your application, but sometimes is a absolute hardware limitation. – Matías Fidemraizer Jul 05 '12 at 09:31
-
@MatíasFidemraizer, It's not about finding the holes in the applicaiton, but seeing how much resources it uses up. Profiling will tell you how much RAM it uses, CPU consumption, disk read/writes. You can profile an optimized, release compiled version of your software to get the most accurate readings. – Filip Ekberg Jul 05 '12 at 09:39
-
No way. You're not understanding me. – Matías Fidemraizer Jul 05 '12 at 10:57
This is obviously related to the lack of hardware power, because it works perfectly on the stronger computers that I used for testing purposes,
Whoever set up testing should be fired.
You have to have one set of computers that are similar to the ones the application will run in for testing. That was accepted practice 20 years ago - seems modern times do not care about that.
Seriously, you NEED to have a test set that is representative on your lowest accepted hardware level.
Otherwise - no, sorry, no magic button. Profilers do NOT necessarily help (debugging, profiler may use more memory). Try a profiler. Optimize code. But at the end... you need to have a decent testbed.

- 61,059
- 10
- 88
- 148
-
Exactly, but the situation that I found myself in is that they called me yesterday to tell me that they bought 5 computers (without consulting me about anything), and that the application needs to be functional for usage today. Welcome to the programmers life, right :D – NDraskovic Jul 05 '12 at 08:24
-
;) That is the time I tell my customer to get real, and turn my daily rate into my hourly rate - I have ZERO intention to fix a mess like that. They can happily go to the next computer shop and get equipment that matches requirements. SO happy not to be an employed guy. – TomTom Jul 05 '12 at 08:27
I'd argue that this should be checked during software installation. Later, if user was prompted for updating his/her hardware and dismissed the warning, you shouldn't care about that.
If you're using Windows Installer (MSI), you can play with a custom action and use System.Management
classes to detect whatever you want.

- 63,804
- 18
- 124
- 206
-
Because users are very well known to read everything they are presented during an installation and to [never click 'Agree' without reading what they agree to](http://www.southparkstudios.com/clips/382786/you-didnt-read-it). – CodeCaster Jul 05 '12 at 09:00
-
@CodeCaster you can always block installation if user doesn't care about such notices! :D – Matías Fidemraizer Jul 05 '12 at 09:29