Increase in Memory allocation after Zoom-In and Zoom-Out operation on a Grid control

Shilpa Neema 0 Reputation points
2023-05-22T13:46:31.1233333+00:00

I am having a GRID control which contains one ImageControl and corresponding Height/Intensity/Color image thumbnails. Now I am performing a simple operation of Zooming In and then again Zooming out my GRID. For this Zoom-In and Zoom-Out Operation I am using "ScaleTransform" property of Grid control.  

Now even after Zooming out the image to previous Zoom value, there is increase in Memory allocation in system.Thus performing this operation multiple times results in quite a good amount of increased memory. On checking with one of the Memory Profiler tool, it has been observed that this increase is related to few WPF controls (For eg: EffectiveValueEntry[], MenuItem, Border, TextBlock, Paths etc)  

Can someone provide any solution for this issue. 

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,678 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,290 questions
{count} votes