Hello, I made an App for Xamarin.Android using RadRadialGauge. I have a Thread that updates the indicator every 500ms based on a received value. The problem is that the longer the App runs the slower it becomes. I checked the RAM usage and it increases really fast, it reaches 200MB in a matter of a few minutes and as result the App becomes very laggy and it doesn't show a good performance. When I try to comment the indicator it works fine. I would like to ask if there is a way to reduce the RAM usage. Here is my Code:
MainPage.xaml
<telerikGauges:RadRadialGauge StartAngle="180" SweepAngle="360">
<telerikGauges:RadRadialGauge.Axis>
<telerikGauges:GaugeLinearAxis Maximum="100"
Minimum="0"
ShowLabels="False"
StrokeThickness="0" />
</telerikGauges:RadRadialGauge.Axis>
<telerikGauges:RadRadialGauge.Ranges>
<telerikGauges:GaugeRangesDefinition Offset="0">
<telerikGauges:GaugeRange Color="#DDDDDD"
From="0"
To="100" />
</telerikGauges:GaugeRangesDefinition>
</telerikGauges:RadRadialGauge.Ranges>
<telerikGauges:RadRadialGauge.Indicators>
<telerikGauges:GaugeBarIndicator x:Name="Needle1" EndCap="Oval"
Fill="#a13127"
StartCap="Oval"
Offset="0"
Value="0.45" />
</telerikGauges:RadRadialGauge.Indicators>
</telerikGauges:RadRadialGauge>
<Label x:Name="GaugeLabel" FontSize="44"
HorizontalTextAlignment="Center"
Text="120"
TextColor="#a13127"
VerticalTextAlignment="Center" />
MainPage.xaml.cs
Thread t = new Thread(new ThreadStart(() =>
{
while (true)
{
Device.BeginInvokeOnMainThread(() =>
{
Needle1.Value = Val; // if I comment this line here RAM usage is normal
GaugeLabel.Text = Val.ToString("0.00");
});
Thread.Sleep(500);
}
}));
t.Start();