Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in / Register
LibVLCSharp
LibVLCSharp
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 82
    • Issues 82
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI/CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VideoLAN
  • LibVLCSharpLibVLCSharp
  • Issues
  • #442

Closed
Open
Created Feb 23, 2021 by Sigurður Jökull@noob

Memory usage grows when switching to new Media in MediaPlayer

Summary

I create a VideoView element in Xamarin.Forms, then i initialize the MediaPlayer with a Media object as a parameter, then when MediaPlayer is already assigned i simply switch the Media object by assigning the Media property of the MediaPlayer. I store the result of the Media getter as a private property of the MainPage class and dispose of it when switching to next media, but still the memory usage climbs each time a new media i assigned and after about 50 videos being played has grown to about a few gigabytes.

Minimal project and steps to reproduce

Github repo https://github.com/siggi90/video_test

(I've set the position of each media at near the end of the video to save time while testing but the result is the same if the playback starts at 0.0f.

  1. Add video files to the playlist (List) private variable to populate the playlist with your own videos.
  2. build and run for macOS (i've tested on both Mojave and Big Sur with same results)
  3. open activity monitor and watch memory usage progressively increase over time.
  4. when playback has completed i noticed memory returns to normal -->

What is the current bug behavior?

Memory usage grows with each successive media being played

What is the expected correct behavior?

I expect each Media's memory to be disposed of when assigning new media and calling Media.Dispose()

Does it work on other plaforms? Does it work with the official VLC apps?

i can provide screenshots of my activity monitor if requested

Relevant logs and/or screenshots

Environment

  • OS: macOS
  • Version 10.14
  • Device: iMac
  • LibVLC 3.1.3.1
  • LibVLCSharp 3.4.9

Possible fixes

The media seems to not dispose of properly, possibly dispose is not working correctly.

Edited Feb 23, 2021 by Sigurður Jökull
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None