sak
14 years agoOccasional Contributor
Takes a long time to get MemUsage info for 1 of 2 processes
I have a system that is running a number of processes, and would like to record the memory usage of two processes over a brief period of time. I have used the following code to write the information to a file:
for (i = 0; i < 10; i++)
{
text = aqString.Format("% 3i:\t%i\t%i\t\r\n", i, Sys.Process(proc1).MemUsage, Sys.Process(proc2).MemUsage);
//text = aqString.Format("% 3i:\t%i\t\r\n", i, Sys.Process(proc1).MemUsage);
//text = aqString.Format("% 3i:\t%i\t\r\n", i, Sys.Process(proc2).MemUsage);
aqFile.WriteToTextFile(sPath, text, aqFile.ctUTF8);
Delay(1000);
}
Whenever I use "Sys.Process(proc2).MemUsage", there is a delay of about 10 seconds and a message "Waiting for proc2" appears in the upper right corner of the screen (I guess that is the status of the executing script); whenever I use "Sys.Process(proc1).MemUsage" the action seems to be immediate. I can see in Task Manager that both processes are running. When I use either line that just writes memory usage for a single process, I only see the ~10 second delay for proc2. I'm guessing that the code above is okay since it works for one process, so I'm wondering what could be different about proc2 that incurs this long delay? Both process are using in the range of 2% to 7% of the processor, which is running at between 15% and 22%. Any ideas or suggestions would be greatly appreciated!
(The numbers that I see for memory usage for both processes are consistent with what Task Manager is showing, so I do seem to be getting the correct data...)
for (i = 0; i < 10; i++)
{
text = aqString.Format("% 3i:\t%i\t%i\t\r\n", i, Sys.Process(proc1).MemUsage, Sys.Process(proc2).MemUsage);
//text = aqString.Format("% 3i:\t%i\t\r\n", i, Sys.Process(proc1).MemUsage);
//text = aqString.Format("% 3i:\t%i\t\r\n", i, Sys.Process(proc2).MemUsage);
aqFile.WriteToTextFile(sPath, text, aqFile.ctUTF8);
Delay(1000);
}
Whenever I use "Sys.Process(proc2).MemUsage", there is a delay of about 10 seconds and a message "Waiting for proc2" appears in the upper right corner of the screen (I guess that is the status of the executing script); whenever I use "Sys.Process(proc1).MemUsage" the action seems to be immediate. I can see in Task Manager that both processes are running. When I use either line that just writes memory usage for a single process, I only see the ~10 second delay for proc2. I'm guessing that the code above is okay since it works for one process, so I'm wondering what could be different about proc2 that incurs this long delay? Both process are using in the range of 2% to 7% of the processor, which is running at between 15% and 22%. Any ideas or suggestions would be greatly appreciated!
(The numbers that I see for memory usage for both processes are consistent with what Task Manager is showing, so I do seem to be getting the correct data...)