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 [EMAIL PROTECTED] ------------------------------------------------------- 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 _______________________________________________ Alsa-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-devel