Opened 17 months ago

Last modified 10 days ago

#14047 assigned bug

Continuous music playback causes dramatic RAM usage

Reported by: dsuden Owned by: leavengood
Priority: normal Milestone: Unscheduled
Component: Kits/Media Kit Version: R1/Development
Keywords: Cc: ttcoder
Blocked By: Blocking:
Has a Patch: no Platform: All

Description

Building up a playlist of songs and leaving it running in Haiku results in a memory leak that could flood a medium sized village within a day. :-) I assume, from the behavior I'm seeing, that each time a new song starts, it leaks a bit more RAM. After 24 hours, I've seen memory consumption over 400MB, and it just keeps going up, the longer the program (MediaPlayer or SoundPlay) is left open and running song after song. This is a serious problem for anyone (like me) who needs the OS to play music for days, weeks, or longer, nonstop.

Change History (7)

comment:1 by diver, 17 months ago

Which process consumes memory? MediaPlayer? Take a screenshot of ProcessController.

comment:2 by cocobean, 15 months ago

Tested: hrev52013 x86_64

Monitored with ProcessController - Memory Usage -> MediaPlayer

MediaPlayer gains about 3MB/hour of consistent audio playback time. App errors/warnings show specific buffer(s) being filled up, but not released umtil application start/exit - not refreshing buffers between each playlist entry or playlist loop.

Last edited 15 months ago by cocobean (previous) (diff)

comment:3 by ttcoder, 5 months ago

Cc: ttcoder added
Component: - GeneralKits/Media Kit
Owner: changed from nobody to Barrett

comment:4 by Barrett, 5 months ago

This is the usual buffer management issue, or at least related to it.

I've been working on that, and I had a WIP, I even offered my help to someone and I was gifted with being accused (once again) for introducing a bug which was there at least 6 years before I even had commit access. The result of how the thing has been handled, is that I'm not going to contribute any information about the resolution of any media kit bug. I just can't continue to bear the situation.

I'm not even an Haiku developer anymore, so there's no hope I will fix that.

comment:5 by korli, 5 months ago

Owner: changed from Barrett to nobody
Status: newassigned

comment:6 by leavengood, 10 days ago

Owner: changed from nobody to leavengood

I am now looking at these sorts of issues.

comment:7 by ttcoder, 10 days ago

Thanks for looking at this one Ryan

This one's easy to setup a test for (just launch MediaPlayer with a big playlist) though it takes time to build up heap consumption

(with a bit of luck, maybe the "time consuming" part can be eliminated by building/releasing a BMediaFile+BMediaTrack pair at full speed a thousand time? see e.g. the .cpp code in #9945 and #11752)

Very curious to see if my patch changes the leak figures, i.e. if less heap is leaked after 1000 iterations.

Note: See TracTickets for help on using tickets.