Giter Site home page Giter Site logo

Comments (9)

wseemann avatar wseemann commented on September 26, 2024 1

Fixed in the latest release, version 1.0.11.

from ffmpegmediametadataretriever.

danielmoraes avatar danielmoraes commented on September 26, 2024

I noticed this same issue on the most recent version of the library.

from ffmpegmediametadataretriever.

MohHeader avatar MohHeader commented on September 26, 2024

me too :(

from ffmpegmediametadataretriever.

denite avatar denite commented on September 26, 2024

Ditto... Any way to get around this?

from ffmpegmediametadataretriever.

Filimindji avatar Filimindji commented on September 26, 2024

Hi,

I have done some research about that. It look like that the native JNI library should be unloaded when the classloader which loaded the library is garbage collected. (according to http://stackoverflow.com/questions/453359/how-to-unload-library-dll-from-java-jvm)

I was hopping that this operation can "resolve" the memory leak. But it don't.

I did a really simple app that do that in a loop :

FFmpegMediaMetadataRetriever mmr = new FFmpegMediaMetadataRetriever();
mmr.setDataSource(desc);
mmr.release();

After ~220 iteration, the app crash.

from ffmpegmediametadataretriever.

wseemann avatar wseemann commented on September 26, 2024

I've looked into this issue and I'm not sure there is a way around it. Android loads FFmpeg each time you create a new instance of FFmpegMediaMetadataRetriever and calling release() doesn't seem to unload the references. I've spent a fair amount of time looking into this issue and I haven't found a solution. As a workaround, it's not necessary to create a new instance of FFmpegMediaMetadataRetriever each time you call setDataSource. Perhaps you should try reusing the same FFmpegMediaMetadataRetriever instance until you have extracted metadata from all the files and then call release() only once.

from ffmpegmediametadataretriever.

Filimindji avatar Filimindji commented on September 26, 2024

Thank you for the feedback.

I think You are right. As a workaround I don't execute my code in a loop, but less frequently after a specific user action.

Now the garbage collector have more opportunity to really release the memory, and my app do not crash anymore.

I think your advise to create only one instance of FFmpegMediaMetadataRetriever is wize. But in my case, the code is placed into an android plugin called by a C# method into an unity project (my interop skills just reach a new level :) and I prefer to avoid multi-thread synchronization and thread safety issue, if any.

from ffmpegmediametadataretriever.

tonggang1308 avatar tonggang1308 commented on September 26, 2024

This issue still is exist at version 1.0.11!

from ffmpegmediametadataretriever.

zjupure avatar zjupure commented on September 26, 2024

still memory leak in native

from ffmpegmediametadataretriever.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.