shinchiro/mpv-winbuild-cmake

libmpv win32 memory leak

Closed this issue · 6 comments

using libmpv from https://sourceforge.net/projects/mpv-player-windows/files/libmpv/

Having a non stop application i initialize and destroy mpv for any video that i play.

if you loop this 3 calls: (without playing anything)

mpvhandle = mpv_create()
mpv_initialize(mpvhandle)
mpv_destroy(mpvhandle)

you have a memory leak of 768 KB at every loop .... approx 768 MB after 1024 loop

the memory leak started on April 12, 2020 with this version:
https://master.dl.sourceforge.net/project/mpv-player-windows/libmpv/mpv-dev-i686-20200412-git-530a086.7z?viasf=1
mpv-version=mpv 0.32.0-352-g530a0863b8
ffmpeg-version=git-2020-04-12-f1894c206

the previous version has no memory leak:
mpv-version=mpv 0.32.0-328-gc5f8ec76b1
ffmpeg-version=git-2020-04-05-8b1f07ef5

i'm not sure if this massive leak is limited to the win32 build or is in the mpv core

is it possible to investigate it?

thank you for the reply

just tested libmpv
mpv-version=mpv 0.35.0-61-g657fd2804c
ffmpeg-version=git-2022-12-23-b92260f70

still the same leak of 768 KB after mpv_initialize / mpv_destroy

ok i will insist with the mpv developers.

https://github.com/shinchiro/mpv-winbuild-cmake/releases
the mp-2.dll of your builds is a dynamic-link library? functions must be called in stdcal? or they are cdecl?
like any other dynamic dll is enough for me to wrap client.h and call the functions of mb-2.dll or there are other steps to do to use the library?

according to mpv there are no leaks in their builds so i want understand if im doing something wrong

avih commented

according to mpv there are no leaks in their builds

Assuming you refer to mpv-player/mpv#9860 , then I didn't say there are no leaks. I saiid I didn't see any leaks so far, and I don't know how to help you further.

I guess it can be closed then