From owner-freebsd-ports-bugs@FreeBSD.ORG Sat Jul 22 03:40:17 2006 Return-Path: X-Original-To: freebsd-ports-bugs@hub.freebsd.org Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A1D1116A4DF for ; Sat, 22 Jul 2006 03:40:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0B97A43D4C for ; Sat, 22 Jul 2006 03:40:17 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k6M3eGNL010598 for ; Sat, 22 Jul 2006 03:40:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k6M3eGeW010597; Sat, 22 Jul 2006 03:40:16 GMT (envelope-from gnats) Resent-Date: Sat, 22 Jul 2006 03:40:16 GMT Resent-Message-Id: <200607220340.k6M3eGeW010597@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Axel Gonzalez Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 37A5516A4DA for ; Sat, 22 Jul 2006 03:37:22 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [216.136.204.117]) by mx1.FreeBSD.org (Postfix) with ESMTP id A619643D46 for ; Sat, 22 Jul 2006 03:37:21 +0000 (GMT) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.13.1/8.13.1) with ESMTP id k6M3bK59062604 for ; Sat, 22 Jul 2006 03:37:20 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.13.1/8.13.1/Submit) id k6M3bKJv062602; Sat, 22 Jul 2006 03:37:20 GMT (envelope-from nobody) Message-Id: <200607220337.k6M3bKJv062602@www.freebsd.org> Date: Sat, 22 Jul 2006 03:37:20 GMT From: Axel Gonzalez To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-2.3 Cc: Subject: ports/100700: [patch] multimedia/kdemultimedia3 arts memory leak when playing ogg and mp3 files X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Jul 2006 03:40:17 -0000 >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@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: