homov / LibMpv

Complete libmpv API wrapper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

High memory usage

navhaxs opened this issue Β· comments

Hey @homov, firstly thanks for putting together this Avalonia wrapper πŸ‘πŸΌ πŸ‘πŸΌ

I do have a question - when I maximise the window, the memory usage grows without bound. Any ideas why?
e.g. 10GB after 30 seconds, 20GB after ~1 minute:
image

It grows very quickly!

Snipaste_2023-06-05_22-16-49
Snipaste_2023-06-05_22-17-06

Hello!
I was unable to replicate your result. When I run I don't see this problem.

Memory consumption when playing in full Window

Ah I figured out how to reproduce. It only happens when I maximise on my big monitor.

You can add Height="1440" Width="2560" to the control, it also triggers the problem this way.

<TabItem Header="OpenGL">
	<Viewbox>
		<local:OpenGlVideoView MpvContext="{Binding OpenGLMpvContext}" Height="1440" Width="2560" />
	</Viewbox>
</TabItem>
<TabItem Header="Software">
	<Viewbox>
		<local:SoftwareVideoView MpvContext="{Binding SoftwareMpvContext}" Height="1440" Width="2560"/>
	</Viewbox>
</TabItem>

Yes you are right. When using opengl, I see the same effect. This effect is not present in software rendering. So far I have no idea why this is happening.

I also tried on Linux. Works without this problem.
Most likely on Windows you need to use native rendering, and on other platforms opengl rendering.
I can assume that this is directly related to libmpv opengl rendering on Windows.

Apparently, the problem is solved in the latest beta versions of Avalonia. Please, confirm if you can.

image

Thanks @homov just tested, looks fixed to me πŸ‘πŸΌ