Page 1 of 1

How to get the amount of memory used by an application?

Posted: Wed Aug 04, 2010 2:09 pm
by CharlesF
Hi folks,

During automated testing I want to log and report the memory used by the target application. Is there a way to do that?

Thanks in advance.
Charles

Re: How to get the amount of memory used by an application?

Posted: Wed Aug 04, 2010 2:33 pm
by Support Team
Hi,

With Ranorex you have fully access to the .Net Framework. To get the memory of a specific process please use following code
System.Diagnostics.Process[] proc = System.Diagnostics.Process.GetProcessesByName("firefox");
Console.WriteLine("Memory used: {0}.", proc[0].PrivateMemorySize.ToString());
Regards,
Peter
Ranorex Team