Knowledge Base Article

Testing Memory in Desktop Apps with TC

In this post I am using the performance counters to and analyze memory use in an order entry application

TestComplete has performance counters available within its many other functions. Here I am using these counters with the developers to spot a memory use issue by walking an order entry line by line.

Enabling Performance Monitoring — just set it up to monitor 'localhost'. Here you can specify the things you would in any other perfmon tool, but it's connected to your test. 👍🏼

I have a few screen grabs and a short 2-min demo .mp4 attached.

In this test I ran 5 orders of 25 line items consecutively with a 60 second delay loop for visibility on the graph between the orders. In the attached graphs you can see the trends look similar but the metrics are different. The application is also holding on to memory after an order is closed, so an order with hundreds of line items will potentially become unstable. This is a WPF application written in C#, so garbage collection should be cleaning things up, but tested over a single order with 200 line items, GC is not reclaiming memory.

The devs use heap dumps to check this, but this is a visual way to show them line by line what is going on by just incrementing through the log.

Testing 4.2.0: ~8:25 AM to ~9:10 AM → approximately 45 minutes total.
Production 4.1.1: ~12:25 PM to ~1:22 PM → approximately 57 minutes total.

Metric

Testing 4.2.015188 total

Production 4.1.1.27856 total

Testing per order (÷5)

Production per order (÷5)

Ratio (Prod ÷ Test)

Gen 2 Heap Size

1,507,640,416

6,011,909,192

~301.5M

~1,202.4M

~3.99×

Private Bytes

3,588,304,896

9,044,623,360

~717.7M

~1,808.9M

~2.52×

Working Set

2,987,810,816

8,390,008,832

~597.6M

~1,678.0M

~2.81×

This shows the time and memory savings over the production version but also shows how memory isn't being reclaimed over time. This is either a hard limitation of a component, or something the developers can enable or code into the app to improve stability.

Have a great day/evening.

Published 1 day ago
Version 1.0
No CommentsBe the first to comment