creewick / uWidgets

Standalone .NET application with a variety of customizable widgets
Other
180 stars 8 forks source link

RAM Usage Issue #38

Closed wahyuabrory closed 1 month ago

wahyuabrory commented 2 months ago

Describe the bug Ram usage over time is insane

Expected behavior At the start of using the widget on startup, it's pretty light. However, over time, the RAM usage increases. In my case, it eventually consumes 1GB of RAM.

Screenshots image Ram Usage

image my widget

Desktop

Crash log

Object reference not set to an instance of an object.
   at Clock.Views.World.OnSizeChanged(Object sender, SizeChangedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEventImpl(RoutedEventArgs e)
   at Avalonia.Interactivity.EventRoute.RaiseEvent(Interactive source, RoutedEventArgs e)
   at Avalonia.Interactivity.Interactive.RaiseEvent(RoutedEventArgs e)
   at Avalonia.Controls.Control.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
   at Avalonia.Controls.ContentControl.OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)
   at Avalonia.Animation.Animatable.OnPropertyChangedCore(AvaloniaPropertyChangedEventArgs change)
   at Avalonia.AvaloniaObject.RaisePropertyChanged[T](AvaloniaProperty`1 property, Optional`1 oldValue, BindingValue`1 newValue, BindingPriority priority, Boolean isEffectiveValue)
   at Avalonia.AvaloniaObject.SetAndRaise[T](DirectPropertyBase`1 property, T& field, T value)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.LayoutHelper.ArrangeChildInternal(Layoutable child, Size availableSize, Thickness padding)
   at Avalonia.Layout.LayoutHelper.ArrangeChild(Layoutable child, Size availableSize, Thickness padding, Thickness borderThickness)
   at Avalonia.Controls.Border.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Grid.ArrangeOverride(Size arrangeSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverrideImpl(Size finalSize, Vector offset)
   at Avalonia.Controls.Presenters.ContentPresenter.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.LayoutHelper.ArrangeChildInternal(Layoutable child, Size availableSize, Thickness padding)
   at Avalonia.Layout.LayoutHelper.ArrangeChild(Layoutable child, Size availableSize, Thickness padding)
   at Avalonia.Controls.Primitives.VisualLayerManager.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Layout.Layoutable.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.Layoutable.ArrangeOverride(Size finalSize)
   at Avalonia.Controls.WindowBase.ArrangeCore(Rect finalRect)
   at Avalonia.Layout.Layoutable.Arrange(Rect rect)
   at Avalonia.Layout.LayoutManager.Arrange(Layoutable control)
   at Avalonia.Layout.LayoutManager.ExecuteInitialLayoutPass()
   at Avalonia.Controls.Window.ShowCore(Window owner)
   at uWidgets.App.OnFrameworkInitializationCompleted()
   at Avalonia.ClassicDesktopStyleApplicationLifetimeExtensions.StartWithClassicDesktopLifetime(AppBuilder builder, String[] args, Action`1 lifetimeBuilder)
   at uWidgets.Program.Main(String[] args)
creewick commented 2 months ago

Woah, that's very high RAM usage It supposed to be around ~100MB in general I will look at this asap, looks like a memory leakage

creewick commented 2 months ago

telegram-cloud-photo-size-4-5972184401007722975-y

Memory leakage confirmed. I will need some more time to figure out the issue and fix it

wahyuabrory commented 2 months ago

take your time buddy

creewick commented 1 month ago

I found the cause of the memory leak. In the Monitor widget, I was using DoubleTransition to animate the circular bar. I will disable that until they fix that or any workaround will be available.

https://github.com/AvaloniaUI/Avalonia/issues/16973

The release will be here soon.

creewick commented 1 month ago

Fixed in 0.6.0