| Summary: | arts memory leak when playing ogg and mp3 files | ||
|---|---|---|---|
| Product: | [Unmaintained] arts | Reporter: | Matthew Stapleton <matthew4196> |
| Component: | general | Assignee: | Stefan Westerfeld <stefan> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Gentoo Packages | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: |
Debug output of Arts playing an ogg file
kdemultimedia_akode_fix_memory_leak.patch |
||
|
Description
Matthew Stapleton
2006-01-04 16:02:21 UTC
Created attachment 14299 [details]
Debug output of Arts playing an ogg file
Here is the arts debug log when playing a ogg file in response to a KDE
notification. I haven't examined the source code much, but looking through the
debug log, it seems that it might be the akode arts plugin that isn't freeing
the memory properly since the memory leak doesn't seem to occur when arts plays
sound files directly (wav).
I know that this might be a bit complicated but maybe somebody can run artsd in valgrind to find some suspicious places in either artsd or akode. I've found out that the gradual increase in memory during sound playback is due to akode memory mapping the file so point 2 isn't a problem. Also, getting akodeplay to play a short ogg file many times doesn't increase the memory usage. Under FreeBSD-6.0 ps axww -O rss,vsz `pgrep artsd` PID RSS VSZ TT STAT TIME COMMAND 47406 11096 16184 ?? S 0:02,90 /usr/local/bin/artsd -F 128 -S 8192 -a toss -m artsmessage -c drkonqi -l 3 -f ps axww -O rss,vsz `pgrep artsd` PID RSS VSZ TT STAT TIME COMMAND 47406 408580 431640 ?? S 95:49,13 /usr/local/bin/artsd -F 128 -S 8192 -a toss -m artsmessage -c drkonqi -l 3 -f This bug appears to have an adverse affect on SWAP file usage. If left alone, the SWAP file becomes full...my system begins to thrash at that point and all I can do is power down. I've resorted to restarting ARTS whenever I see memory usage increase above 100,000 as reported in KSYSGUARD. This action results in immediate relief in memory usage and swap file usage. Most of my KDE sound activity comes from email notifications and KOPETE notifications. If you run KSYSGUARD and then open KDE Control Center to System Notification, use "Play Sound" with any system notification selected and watch the memory usage increase for ARTSD Created attachment 14913 [details]
kdemultimedia_akode_fix_memory_leak.patch
Here is a patch to fix the memory leak. The key to using valgrind to find the
problem was to close artsd while the akode plugin was still loaded. Then
valgrind was able to see the library where the lost memory was from instead of
showing ???.
Could this patch be committed to svn please? SVN commit 550832 by carewolf:
Commit my personal changes, so I am not the only one with an artsd that doesn't
leak *shame on me*
BUG:119504
M +4 -3 akodePlayObject_impl.cpp
--- branches/KDE/3.5/kdemultimedia/akode_artsplugin/akodePlayObject_impl.cpp #550831:550832
@@ -82,6 +82,8 @@
akodePlayObject_impl::~akodePlayObject_impl()
{
+ delete m_packetQueue;
+
unload();
}
@@ -219,10 +221,9 @@
delete bufferedDecoder;
bufferedDecoder = 0;
}
-#else
+#endif
delete frameDecoder
frameDecoder = 0;
-#endif
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()) {
SVN commit 550906 by mpyne:
Make the memory leak fix compile.
CCBUG:119504
M +1 -1 akodePlayObject_impl.cpp
--- branches/KDE/3.5/kdemultimedia/akode_artsplugin/akodePlayObject_impl.cpp #550905:550906
@@ -222,7 +222,7 @@
bufferedDecoder = 0;
}
#endif
- delete frameDecoder
+ delete frameDecoder;
frameDecoder = 0;
decoder = 0;
if (buffer != inBuffer)
|