All of lore.kernel.org
 help / color / mirror / Atom feed
From: mru@users.sourceforge.net (Måns Rullgård)
To: alsa-devel@lists.sourceforge.net
Subject: Memory leaks in alsa-lib
Date: Mon, 25 Aug 2003 18:07:45 +0200	[thread overview]
Message-ID: <yw1xznhxpvou.fsf@users.sourceforge.net> (raw)


Is there a memory leak in alsa-lib?  When playing music with a player
I'm writing (TCVP, http://tcvp.sf.net), the memory usage reported by
top grows for each file I play, but only if I use ALSA for sound
playback.  If I use OSS the memory usage varies around 1.5 MB, but if
I use ALSA, it starts at 1.9 MB (OK, libasound takes some space) and
grows by 30-40 kB for each played file.  Running the whole thing under
valgrind gives me this, which is all alsa-related.  When using OSS,
valgrind reports no leaks.

==3078== 8 bytes in 1 blocks are still reachable in loss record 1 of 20
==3078==    at 0x4002AC23: calloc (../../../valgrind/coregrind/vg_replace_malloc.c:273)
==3078==    by 0x4377069D: snd_config_update_r (conf.c:2953)
==3078==    by 0x43770D67: snd_config_update (conf.c:3095)
==3078==    by 0x43789CC6: snd_pcm_open (pcm.c:1929)
==3078==    by 0x4373C262: alsa_open (../../../../../tcvp/src/output/alsa/alsa.c:355)
==3078==    by 0x424D6E13: new_pipe (../../../../tcvp/src/tcvp/tcvp.c:328)
==3078==    by 0x424D76B9: t_open (../../../../tcvp/src/tcvp/tcvp.c:453)
==3078==    by 0x424D7AC9: t_event (../../../../tcvp/src/tcvp/tcvp.c:581)
==3078==    by 0x402737B3: thread_wrapper (../../../valgrind/coregrind/vg_libpthread.c:667)
==3078==    by 0x40175153: do__quit (../../../valgrind/coregrind/vg_scheduler.c:2146)
==3078== 
==3078== 
==3078== 20 bytes in 1 blocks are still reachable in loss record 6 of 20
==3078==    at 0x4002AC23: calloc (../../../valgrind/coregrind/vg_replace_malloc.c:273)
==3078==    by 0x437706DC: snd_config_update_r (conf.c:2957)
==3078==    by 0x43770D67: snd_config_update (conf.c:3095)
==3078==    by 0x43789CC6: snd_pcm_open (pcm.c:1929)
==3078==    by 0x4373C262: alsa_open (../../../../../tcvp/src/output/alsa/alsa.c:355)
==3078==    by 0x424D6E13: new_pipe (../../../../tcvp/src/tcvp/tcvp.c:328)
==3078==    by 0x424D76B9: t_open (../../../../tcvp/src/tcvp/tcvp.c:453)
==3078==    by 0x424D7AC9: t_event (../../../../tcvp/src/tcvp/tcvp.c:581)
==3078==    by 0x402737B3: thread_wrapper (../../../valgrind/coregrind/vg_libpthread.c:667)
==3078==    by 0x40175153: do__quit (../../../valgrind/coregrind/vg_scheduler.c:2146)
==3078== 
==3078== 
==3078== 48 bytes in 5 blocks are still reachable in loss record 8 of 20
==3078==    at 0x4002A745: malloc (../../../valgrind/coregrind/vg_replace_malloc.c:153)
==3078==    by 0x4376C5E2: get_delimstring (conf.c:769)
==3078==    by 0x4376C6BF: get_string (conf.c:819)
==3078==    by 0x4376C968: parse_value (conf.c:896)
==3078==    by 0x4376CCB7: parse_array_def (conf.c:1029)
==3078==    by 0x4376CE7B: parse_array_defs (conf.c:1051)
==3078==    by 0x4376D16F: parse_def (conf.c:1170)
==3078==    by 0x4376D34D: parse_defs (conf.c:1213)
==3078==    by 0x4376CD90: parse_array_def (conf.c:1008)
==3078==    by 0x4376CE7B: parse_array_defs (conf.c:1051)
==3078==    by 0x4376D16F: parse_def (conf.c:1170)
==3078==    by 0x4376D34D: parse_defs (conf.c:1213)
==3078==    by 0x4376CD90: parse_array_def (conf.c:1008)
==3078==    by 0x4376CE7B: parse_array_defs (conf.c:1051)
==3078==    by 0x4376D16F: parse_def (conf.c:1170)
==3078==    by 0x4376D34D: parse_defs (conf.c:1213)
==3078==    by 0x4376DE43: snd_config_load1 (conf.c:1544)
==3078==    by 0x4376DFDF: snd_config_load (conf.c:1593)
==3078== 
==3078== 
==3078== 173 bytes in 69 blocks are still reachable in loss record 10 of 20
==3078==    at 0x4002A745: malloc (../../../valgrind/coregrind/vg_replace_malloc.c:153)
==3078==    by 0x4030B0CF: __GI___strdup (in /lib/libc-2.3.1.so)
==3078==    by 0x437707DC: snd_config_update_r (conf.c:2979)
==3078==    by 0x43770D67: snd_config_update (conf.c:3095)
==3078==    by 0x43789CC6: snd_pcm_open (pcm.c:1929)
==3078==    by 0x4373C262: alsa_open (../../../../../tcvp/src/output/alsa/alsa.c:355)
==3078==    by 0x424D6E13: new_pipe (../../../../tcvp/src/tcvp/tcvp.c:328)
==3078==    by 0x424D76B9: t_open (../../../../tcvp/src/tcvp/tcvp.c:453)
==3078==    by 0x424D7AC9: t_event (../../../../tcvp/src/tcvp/tcvp.c:581)
==3078==    by 0x402737B3: thread_wrapper (../../../valgrind/coregrind/vg_libpthread.c:667)
==3078==    by 0x40175153: do__quit (../../../valgrind/coregrind/vg_scheduler.c:2146)
==3078== 
==3078== 
==3078== 4820 bytes in 643 blocks are still reachable in loss record 16 of 20
==3078==    at 0x4002A745: malloc (../../../valgrind/coregrind/vg_replace_malloc.c:153)
==3078==    by 0x4376C45B: get_freestring (conf.c:711)
==3078==    by 0x4376C6EE: get_string (conf.c:825)
==3078==    by 0x4376CF1F: parse_def (conf.c:1086)
==3078==    by 0x4376D34D: parse_defs (conf.c:1213)
==3078==    by 0x4376DE43: snd_config_load1 (conf.c:1544)
==3078==    by 0x4376DFDF: snd_config_load (conf.c:1593)
==3078==    by 0x437709C5: snd_config_update_r (conf.c:3054)
==3078==    by 0x43770D67: snd_config_update (conf.c:3095)
==3078==    by 0x43789CC6: snd_pcm_open (pcm.c:1929)
==3078==    by 0x4373C262: alsa_open (../../../../../tcvp/src/output/alsa/alsa.c:355)
==3078==    by 0x424D6E13: new_pipe (../../../../tcvp/src/tcvp/tcvp.c:328)
==3078==    by 0x424D76B9: t_open (../../../../tcvp/src/tcvp/tcvp.c:453)
==3078==    by 0x424D7AC9: t_event (../../../../tcvp/src/tcvp/tcvp.c:581)
==3078==    by 0x402737B3: thread_wrapper (../../../valgrind/coregrind/vg_libpthread.c:667)
==3078==    by 0x40175153: do__quit (../../../valgrind/coregrind/vg_scheduler.c:2146)
==3078== 
==3078== 
==3078== 5504 bytes in 172 blocks are still reachable in loss record 17 of 20
==3078==    at 0x4002AC23: calloc (../../../valgrind/coregrind/vg_replace_malloc.c:273)
==3078==    by 0x4376C73A: _snd_config_make (conf.c:836)
==3078==    by 0x4376DD52: snd_config_top (conf.c:1525)
==3078==    by 0x43770927: snd_config_update_r (conf.c:3045)
==3078==    by 0x43770D67: snd_config_update (conf.c:3095)
==3078==    by 0x43789CC6: snd_pcm_open (pcm.c:1929)
==3078==    by 0x4373C262: alsa_open (../../../../../tcvp/src/output/alsa/alsa.c:355)
==3078==    by 0x424D6E13: new_pipe (../../../../tcvp/src/tcvp/tcvp.c:328)
==3078==    by 0x424D76B9: t_open (../../../../tcvp/src/tcvp/tcvp.c:453)
==3078==    by 0x424D7AC9: t_event (../../../../tcvp/src/tcvp/tcvp.c:581)
==3078==    by 0x402737B3: thread_wrapper (../../../valgrind/coregrind/vg_libpthread.c:667)
==3078==    by 0x40175153: do__quit (../../../valgrind/coregrind/vg_scheduler.c:2146)
==3078== 
==3078== 
==3078== 9024 bytes in 282 blocks are possibly lost in loss record 19 of 20
==3078==    at 0x4002AC23: calloc (../../../valgrind/coregrind/vg_replace_malloc.c:273)
==3078==    by 0x4376C73A: _snd_config_make (conf.c:836)
==3078==    by 0x4376C80B: _snd_config_make_add (conf.c:862)
==3078==    by 0x4376CA4D: parse_value (conf.c:956)
==3078==    by 0x4376D0F3: parse_def (conf.c:1184)
==3078==    by 0x4376D34D: parse_defs (conf.c:1213)
==3078==    by 0x4376CD90: parse_array_def (conf.c:1008)
==3078==    by 0x4376CE7B: parse_array_defs (conf.c:1051)
==3078==    by 0x4376D16F: parse_def (conf.c:1170)
==3078==    by 0x4376D34D: parse_defs (conf.c:1213)
==3078==    by 0x4376DE43: snd_config_load1 (conf.c:1544)
==3078==    by 0x4376DFDF: snd_config_load (conf.c:1593)
==3078==    by 0x437709C5: snd_config_update_r (conf.c:3054)
==3078==    by 0x43770D67: snd_config_update (conf.c:3095)
==3078==    by 0x43789CC6: snd_pcm_open (pcm.c:1929)
==3078==    by 0x4373C262: alsa_open (../../../../../tcvp/src/output/alsa/alsa.c:355)
==3078==    by 0x424D6E13: new_pipe (../../../../tcvp/src/tcvp/tcvp.c:328)
==3078==    by 0x424D76B9: t_open (../../../../tcvp/src/tcvp/tcvp.c:453)


-- 
Måns Rullgård
mru@users.sf.net


-------------------------------------------------------
This SF.net email is sponsored by: VM Ware
With VMware you can run multiple operating systems on a single machine.
WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines
at the same time. Free trial click here:http://www.vmware.com/wl/offer/358/0

             reply	other threads:[~2003-08-25 16:07 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-08-25 16:07 Måns Rullgård [this message]
2003-08-26 10:07 ` Memory leaks in alsa-lib Jaroslav Kysela
2003-08-26 11:53   ` Måns Rullgård
2003-08-26 12:33     ` Jaroslav Kysela
2003-08-26 13:14       ` Måns Rullgård

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=yw1xznhxpvou.fsf@users.sourceforge.net \
    --to=mru@users.sourceforge.net \
    --cc=alsa-devel@lists.sourceforge.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.