I have a program that I am writing and would like to know the memory requirements that it needs. Is there a way of determining this other than examining it through another process (like Windows Task Manager)? I need to publish its memory requirements and recommendations. Also, how can I tell the program is needing use of a swap file? Any help would be greatly appreciated.
Swap file will be dependent on the amount of RAM the target system has.
You can get the memory requirements 2 ways.
1) Run the application and monitor it's memory usage. Through task manager or performance monitor.
2) Use a professional (or possibly open source) profiling tool. This will keep track of the memory usage of your application and report it back to you once you have finished execution.
Without actually running the application it's impossible to estimate the amount of memory usage. Especially if you are using a lazy-allocation style design pattern.
So there is no way to report on the memory usage from within the application itself? Can you recommend a profiling tool that would be good to use? Thanks.
It maybe a bit over-kill for what you are after. Personally. I'd look at the Task Manager when you have the application in use and add 25% to that. Then say thats the Min requirements memory-wise.
Process Explorer not only tells you the current memory usage, it also tells you the peak usage, it plots it on a graph along with CPU usage and IO bytes/unit of time. It also reports a myriad of other parameters, such as total CPU time (both in kernel and user), virtual memory usage, threads, TCP/UDP connections, etc.