Memory leak / steady increase running voe tests

64 views
Skip to first unread message

JPhi1618

unread,
Sep 27, 2011, 3:51:33 PM9/27/11
to discuss-webrtc
We are using the voice engine in a product, and we noticed a steady
memory increase over time, and I have verified that it is not being
caused by our code. I have made some of my own tests that call
StartPlayout and StopPlayout repeatedly, and every test I do shows a
steady memory increase that seems to be related to the number of times
I'm calling Start/StopPlayout.

So, I tried the tests in the voe_auto_test project. If I run "Stress
Tests" and then the "Start Stop Playout" test, the test starts using
16MB of memory, and after running for a while, I can see a constant
and steady increase in memory usage. when the test completes, it is
using over 43MB of memory.

Has any one else noticed this? (I'm using Windows7, and compiling with
VS2008) Is this reproduceable by anyone else? This slow but steady
increase will overwhelm a long-running system until CreateThread
starts to fail because of a lack of memory.

JPhi1618

unread,
Sep 27, 2011, 4:10:41 PM9/27/11
to discuss-webrtc
Just noticed something else using some of my test code. This causes a
memory increase over time:

-------------------------------------------
chan1 = CreateChannel();
forLoop
{
StartPlayout(chan1);
Sleep();
StopPlayout(chan1);
Sleep();
}
//Done here, clean up...
-------------------------------------------

When this is done the memory use is constant:
-------------------------------------------
chan1 = CreateChannel();
chan2 = CreateChannel();
StartPlayout(chan2);

forLoop
{
StartPlayout(chan1);
Sleep();
StopPlayout(chan1);
Sleep();
}

StopPlayout(chan2)
//Done here, clean up...
-------------------------------------------

So, as long as at least one channel is playing, there is no mem
increase. If ALL channels are stopped, and then started, there is a
problem. I'm going to look at the voe source for more details.

Henrik Andreasson

unread,
Sep 27, 2011, 4:59:06 PM9/27/11
to discuss...@googlegroups.com
If you are able to show an issue using WebRTC code only, you should file an an Issue report in the Issue tracker (http://code.google.com/p/webrtc/issues/list). 

Best way forward would be if you could use the UI based Windows test application and reproduce the issue in the CWinTestDlg::OnBnClickedButtonTest1() method in https://code.google.com/p/webrtc/source/browse/trunk/src/voice_engine/main/test/win_test/WinTestDlg.cpp.

We must be able to reproduce internally to assist.

You could also try to install VLD (Visual Leak Detector) on your machine, and see if you can detect any memory leaks.

If memory leaks are found in your test. Take a few steps back in the revision history and see if it is possible to find a revision which does not leak.

Thanks

/Henrik

JPhi1618

unread,
Sep 27, 2011, 5:27:12 PM9/27/11
to discuss-webrtc
Thanks for the reply. Is this the VLD you are refering to?

http://vld.codeplex.com/

I will attempt to reproduce the code in the UI Windows test, and
gather more information. Once I'm sure I've done my "due diligence" I
will file an issue with all of the pertinent details.

I have isolated the problem to the Core audio device in windows. If I
explicitly set VoE to use Wave audio, I cannot reproduce the issue.



On Sep 27, 3:59 pm, Henrik Andreasson <henr...@webrtc.org> wrote:
> If you are able to show an issue using WebRTC code only, you should file an
> an Issue report in the Issue tracker (http://code.google.com/p/webrtc/issues/list).
>
> Best way forward would be if you could use the UI based Windows test
> application and reproduce the issue in the
> CWinTestDlg::OnBnClickedButtonTest1()
> method inhttps://code.google.com/p/webrtc/source/browse/trunk/src/voice_engine...
> .

Henrik Andreasson

unread,
Sep 28, 2011, 4:33:13 AM9/28/11
to discuss...@googlegroups.com
Nice work!

Revision 592 contains a non-trivial change to the Core Audio layer. Please try an earlier version and compare.

And yes, your link is correct.

Thanks.

JPhi1618

unread,
Sep 28, 2011, 10:52:34 AM9/28/11
to discuss-webrtc
Your revision numbers sure move fast! I'm actually using a r329 that
I pulled down in August. Now I feel bad because I didn't realize how
old of a revision I was using.
I'll pull a newer revision and see if the issue is still present. I
didn't realize how active the development on this project was!
I'm going to have to figure out how to get a particular revision, but
I think I can figure that out.

Andrew MacDonald

unread,
Sep 28, 2011, 1:04:01 PM9/28/11
to discuss...@googlegroups.com
On Wed, Sep 28, 2011 at 7:52 AM, JPhi1618 <jphi...@gmail.com> wrote:
Your revision numbers sure move fast!  I'm actually using a r329 that
I pulled down in August.  Now I feel bad because I didn't realize how
old of a revision I was using.
I'll pull a newer revision and see if the issue is still present.  I
didn't realize how active the development on this project was!
I'm going to have to figure out how to get a particular revision, but
I think I can figure that out.

$ gclient sync -r <revision_number>
(Have a look at "gclient help sync")

JPhi1618

unread,
Sep 29, 2011, 11:56:25 AM9/29/11
to discuss-webrtc
Just in case anyone reads this in the discussions later, please note
that I have filed an issue report, and more details can be found under
issue #101.
Reply all
Reply to author
Forward
0 new messages