I have three nested grids where first two of them has background images with sizes 291 KB and 185 KB. When i run the app i see that my app is using about 130 MB of RAM. I debugged the app to see what causes such a huge memory consumption and realized that when i remove background images it decreases to about 25 mb.
Am i doing something wrong? You can find the markup below.
<Grid Style="{StaticResource LayoutRootStyle}">
<Grid.Background>
<ImageBrush ImageSource="Assets/Images/bubbleless_background.png" />
</Grid.Background>
<Grid>
<Grid.Background>
<ImageBrush ImageSource="Assets/Images/bubble_background_new.png" Stretch="None" AlignmentX="Left" AlignmentY="Top"/>
</Grid.Background>
</Grid>
</Grid>
The size of the image on disk is NOT a measurement for the size in memory.
In memory the size is
its width * its height in pixels * 4 bytes per pixelYou are adding two images; depending on their sizes (in pixels!) this can take a lot of memory.