djones7936
Programmer
Hi
I have a weird problem. I have a program that loads about 20-30MB worth of arrays using the new operator, the program does some processing, then it uses the delete operator to release the all of the said memory that was allocated. My understanding is the delete operator unallocates memory which can be used again. The program continues with this loading and unloading process many times before it actually exits.
I'm pretty sure I do not have "memory leaks"; that is I use a delete operator for every new operator, (there shouldn't be any orphaned allocated memory taking up space.)
In Windows XP's Task Manager, as my program runs, it's "Memory Usage" (under the "Processes" tab) flucuates between 40MB-100MB (which is good). Unfortunately, also as my program runs, the Page File Usage continues to rise well past 800MB. (I only have 256MB of RAM so this sucks. ) I can't have my program "use" so much memory. :-(
Currently, the amount of memory taken up by all of my processes is about 60MB (including my program), and the page file usage is at 870MB.
Does anyone know why the page file usage is so high even though the memory usage for the program is under 100MB? I thought using the delete operator frees memory. Is there any way to decrease the amount of page file usage (Virtual Memory usage)? How can I get my program to use a normal amount of memory?
Help! Thanks!,
-Dave
I have a weird problem. I have a program that loads about 20-30MB worth of arrays using the new operator, the program does some processing, then it uses the delete operator to release the all of the said memory that was allocated. My understanding is the delete operator unallocates memory which can be used again. The program continues with this loading and unloading process many times before it actually exits.
I'm pretty sure I do not have "memory leaks"; that is I use a delete operator for every new operator, (there shouldn't be any orphaned allocated memory taking up space.)
In Windows XP's Task Manager, as my program runs, it's "Memory Usage" (under the "Processes" tab) flucuates between 40MB-100MB (which is good). Unfortunately, also as my program runs, the Page File Usage continues to rise well past 800MB. (I only have 256MB of RAM so this sucks. ) I can't have my program "use" so much memory. :-(
Currently, the amount of memory taken up by all of my processes is about 60MB (including my program), and the page file usage is at 870MB.
Does anyone know why the page file usage is so high even though the memory usage for the program is under 100MB? I thought using the delete operator frees memory. Is there any way to decrease the amount of page file usage (Virtual Memory usage)? How can I get my program to use a normal amount of memory?
Help! Thanks!,
-Dave