That problem is not decidable. It's not possible to write a static analysis tool to find out how much memory a program uses. However, if you wrote the program, you really should have a decent estimation of how much memory it uses. If you need to know more specifically how much (like if you've just implemented a space-for-speed optimization, and can only estimate it'll take at least an order of magnitude more space), run 'top', sort by memory consumption and watch for your process. I've found that if you use more than about 50% of the total memory in the system, you are in danger of swap-thrashing.
Of course, all of this depends on whether the program is written in a language in C or C++ where you actually can care about resources.
|