Discussion:
[Audiere-users] memory leak revisited
Jacky J
2007-04-23 17:54:48 UTC
Permalink
Now that the mailing list is active again, any luck with the memory leak on
windows? I posted a message about this a while ago, but i guess the
conversation sort of trailed off. Here were the messages

http://sourceforge.net/mailarchive/forum.php?thread_name=976c67140611111436x278bd58cse8521da2f962cb61%40mail.gmail.com&forum_name=audiere-users
http://sourceforge.net/mailarchive/forum.php?thread_name=976c67140611012344x5e6d8c72rd428cada5105b448%40mail.gmail.com&forum_name=audiere-users

Thanks
Enno Rehling
2007-04-23 22:03:47 UTC
Permalink
Post by Jacky J
Now that the mailing list is active again, any luck with the memory leak
on windows? I posted a message about this a while ago, but i guess the
conversation sort of trailed off. Here were the messages
I ran your program through Purify, and can't see any of those memory
leaks. Well, except for some memory from DLL loading (544 bytes) and
from DirectSound that is apparently not released (4 blocks of 22 bytes
each, in waveOutMessage), but nothing related to Audiere directly.

Enno.
--
PATRIOT, n. One to whom the interests of a part seem superior to
those of the whole. The dupe of statesmen and the tool of conquerors.
- Ambrose Bierce, 1906
Jacky J
2007-04-24 04:06:15 UTC
Permalink
Hmm.. What version of Visual Studio are you using? I'm not familiar with
Purify, but can you just open up task manager and read me the "Mem Usage" of
audtest.exe at every cin.get() in my program?
Basically, the memory usage should stay the same throughout the program.
However, when i run it, it starts out at about 4,000k, then jumps up to
8,000k due to memory leaks. Only when the Device gets set to NULL does the
memory get freed.

Thanks
Post by Enno Rehling
Post by Jacky J
Now that the mailing list is active again, any luck with the memory leak
on windows? I posted a message about this a while ago, but i guess the
conversation sort of trailed off. Here were the messages
I ran your program through Purify, and can't see any of those memory
leaks. Well, except for some memory from DLL loading (544 bytes) and
from DirectSound that is apparently not released (4 blocks of 22 bytes
each, in waveOutMessage), but nothing related to Audiere directly.
Enno.
--
PATRIOT, n. One to whom the interests of a part seem superior to
those of the whole. The dupe of statesmen and the tool of conquerors.
- Ambrose Bierce, 1906
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
Chad Austin
2007-04-24 07:57:00 UTC
Permalink
"Mem usage" is actually not a very good way to test for the memory
requirements of an application. It represents the working set of an
application, which can depend on your operation system, its loading
strategies, the load of the system, etc. "VM Size" is generally more
useful.

http://en.wikipedia.org/wiki/Working_set
http://en.wikipedia.org/wiki/Virtual_memory
http://en.wikipedia.org/wiki/Page_file
http://en.wikipedia.org/wiki/Address_space
Post by Jacky J
Hmm.. What version of Visual Studio are you using? I'm not familiar with
Purify, but can you just open up task manager and read me the "Mem Usage" of
audtest.exe at every cin.get() in my program?
Basically, the memory usage should stay the same throughout the program.
However, when i run it, it starts out at about 4,000k, then jumps up to
8,000k due to memory leaks. Only when the Device gets set to NULL does the
memory get freed.
Thanks
Post by Enno Rehling
Post by Jacky J
Now that the mailing list is active again, any luck with the memory leak
on windows? I posted a message about this a while ago, but i guess the
conversation sort of trailed off. Here were the messages
I ran your program through Purify, and can't see any of those memory
leaks. Well, except for some memory from DLL loading (544 bytes) and
from DirectSound that is apparently not released (4 blocks of 22 bytes
each, in waveOutMessage), but nothing related to Audiere directly.
Enno.
--
PATRIOT, n. One to whom the interests of a part seem superior to
those of the whole. The dupe of statesmen and the tool of conquerors.
- Ambrose
Bierce, 1906
-------------------------------------------------------------------------
Post by Enno Rehling
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
--
Chad Austin
http://imvu.com/technology
Jacky J
2007-04-25 05:01:01 UTC
Permalink
Regardless, a memory leak is still a memory leak. Running my program, VM
size grows and grows, even though i never have more than one sound allocated
at a time.

I'm getting this on several computers and other people are getting it as
well (
http://basic4gl.proboards20.com/index.cgi?board=Announce&action=display&thread=1150887858
)
If for some reason you can't reproduce it, i suggest running it under the
same environment (windows xp sp 2, visual express c++ sp1, audiere 1.9.4,
directx 9.0c april)

I'm doing you a favor by helping you find this bug, so i need you to help me
debug it by running audtest.exe and reading me your "VM Size" at each
message in the program.
here's the link again http://www.cs.utah.edu/~witkowsk/files/audtest.zip

Thank you
Post by Chad Austin
"Mem usage" is actually not a very good way to test for the memory
requirements of an application. It represents the working set of an
application, which can depend on your operation system, its loading
strategies, the load of the system, etc. "VM Size" is generally more
useful.
http://en.wikipedia.org/wiki/Working_set
http://en.wikipedia.org/wiki/Virtual_memory
http://en.wikipedia.org/wiki/Page_file
http://en.wikipedia.org/wiki/Address_space
Post by Jacky J
Hmm.. What version of Visual Studio are you using? I'm not familiar
with
Post by Jacky J
Purify, but can you just open up task manager and read me the "Mem
Usage" of
Post by Jacky J
audtest.exe at every cin.get() in my program?
Basically, the memory usage should stay the same throughout the program.
However, when i run it, it starts out at about 4,000k, then jumps up to
8,000k due to memory leaks. Only when the Device gets set to NULL does
the
Post by Jacky J
memory get freed.
Thanks
Post by Enno Rehling
Post by Jacky J
Now that the mailing list is active again, any luck with the memory
leak
Post by Jacky J
Post by Enno Rehling
Post by Jacky J
on windows? I posted a message about this a while ago, but i guess
the
Post by Jacky J
Post by Enno Rehling
Post by Jacky J
conversation sort of trailed off. Here were the messages
I ran your program through Purify, and can't see any of those memory
leaks. Well, except for some memory from DLL loading (544 bytes) and
from DirectSound that is apparently not released (4 blocks of 22 bytes
each, in waveOutMessage), but nothing related to Audiere directly.
Enno.
--
PATRIOT, n. One to whom the interests of a part seem superior to
those of the whole. The dupe of statesmen and the tool of conquerors.
- Ambrose
Bierce, 1906
-------------------------------------------------------------------------
Post by Jacky J
Post by Enno Rehling
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
-------------------------------------------------------------------------
Post by Jacky J
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
--
Chad Austin
http://imvu.com/technology
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
Enno Rehling
2007-04-25 17:41:34 UTC
Permalink
It appears that the IDirectSoundNotify interface is not released. See
device_ds_buffer.cpp:31 and following. I made a little testcase and
after calling notify->Release() memory is properly freed. Otherwise
freeing it is delayed until the device is released, when DXSound
releases all resources for historical reasons (which led me on a wild
goose chase).

I suggest making notify a member variable and releasing it in the dtor -
I'll commit a fix in a little bit.

Enno.
--
"I would have made a good Pope."
- Richard M. Nixon.
Chad Austin
2007-04-25 18:15:06 UTC
Permalink
Good catch! Thanks Enno!
Post by Enno Rehling
It appears that the IDirectSoundNotify interface is not released. See
device_ds_buffer.cpp:31 and following. I made a little testcase and
after calling notify->Release() memory is properly freed. Otherwise
freeing it is delayed until the device is released, when DXSound
releases all resources for historical reasons (which led me on a wild
goose chase).
I suggest making notify a member variable and releasing it in the dtor -
I'll commit a fix in a little bit.
Enno.
--
"I would have made a good Pope."
- Richard M. Nixon.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Audiere-users mailing list
https://lists.sourceforge.net/lists/listinfo/audiere-users
--
Chad Austin
http://imvu.com/technology
Loading...