ports/100700: [patch] multimedia/kdemultimedia3 arts memory leak when playing ogg and mp3 files

Axel Gonzalez loox at e-shell.net
Sat Jul 22 03:40:17 UTC 2006


>Number:         100700
>Category:       ports
>Synopsis:       [patch] multimedia/kdemultimedia3 arts memory leak when playing ogg and mp3 files
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 22 03:40:16 GMT 2006
>Closed-Date:
>Last-Modified:
>Originator:     Axel Gonzalez
>Release:        FreeBSD 6.1-STABLE
>Organization:
>Environment:
FreeBSD moonlight 6.1-STABLE FreeBSD 6.1-STABLE #0: Sun Jul 16 15:13:53 CDT 2006     loox at moonlight:/usr/obj/usr/src/sys/LXAMD64  amd64
>Description:
Copied from:
http://bugs.kde.org/show_bug.cgi?id=119504

The primary artsd process is leaking memory when it plays ogg and mp3 files.  Since KDE uses ogg files for sound events, after about a week artsd is using a lot of memory which slows the system down. 
 The VmSize, VmRSS, and VmData all increase at the beginning of ogg playback then when it finishes playing not all of that used memory is freed.  I also noticed that when playing a long ogg file the VmRSS will constantly grow by a few kB during every second of playback.  The same thing happens with mp3 files but not as bad as with ogg files.  Playing wav files however allocates very little memory in artsd and the usage doesn't increase during playback. 
>How-To-Repeat:
Copied from:
http://bugs.kde.org/show_bug.cgi?id=119504

How to Reproduce: 
 1. Play an ogg or mp3 file with artsplay, noatun, or a KDE event 
 2. Watch the artsd memory usage increase while it plays 
 3. Wait until it finishes playing or manually stop the playback 
 4. Notice the slightly increased memory usage of the main artsd process since before playing the file
>Fix:
This patch is from the patches at:
http://bugs.kde.org/show_bug.cgi?id=11950

I merged the patches to make it ready to commit:


files/patch-akode_artsplugin_akodePlayObject_impl.cpp
************************************
--- akode_artsplugin/akodePlayObject_impl.cpp.orig	Fri Jul 21 22:10:02 2006
+++ akode_artsplugin/akodePlayObject_impl.cpp	Fri Jul 21 22:13:13 2006
@@ -82,6 +82,8 @@
 
 akodePlayObject_impl::~akodePlayObject_impl()
 {
+    delete m_packetQueue;
+
     unload();
 }
 
@@ -219,10 +221,9 @@
         delete bufferedDecoder;
         bufferedDecoder = 0;
     }
-#else
-    delete frameDecoder
-    frameDecoder = 0;
 #endif
+    delete frameDecoder;
+    frameDecoder = 0;
     decoder = 0;
     if (buffer != inBuffer)
         delete inBuffer;
@@ -301,7 +302,7 @@
 {
     arts_debug("akode: readFrame");
 
-    if (!buffer || !decoder) return false;
+    if (!inBuffer || !decoder) return false;
     if (m_bytebuffer) processQueue();
     if(!decoder->readFrame(inBuffer)) {
         if (decoder->eof()) {

>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list