Search code examples
c#memory-managementwindows-serviceswindows-server-2012

Monitoring memory in a Windows service


I'm writing a Windows service that connects to a public Web service and downloads the incremental data to my own database. The service has been in operation for several years and the data is really a lot, so the first start-up takes on the order of days (three years records of the date of start-up takes approximately 4 days).

The service always returns a maximum of 1000 records in a way that either greater than or equal to the inserted record ID, or from the date of record (it's silly, I know, but I can not affect it).

On the server where the service is running I'm limited memory (only about 1.5 GB). For testing I need to know how much memory it takes to I could be optimized code or change the method of data collection.

Do you know any tool that would do report how much memory the moment in which the service is used?

Thank you


Solution

  • In test you can use Visual Studio Profiler, It has a memory allocation profile: In Visual Studio go to the Analyze menu and select “Launch Performance Wizard…" and select .NET Memory Allocation (Sampling)