|
-
Aug 24th, 2022, 12:15 PM
#1
Thread Starter
New Member
WaveInRecorder.cls causes memory leak?
In a VB6 application I use the WaveInRecorder class to record and monitor the audio input of the soundcard. With this application I record files from 1 hour. Then the recording stops, and a new recording wil start. This applications runs 24/7. When I look in the taskmanager from Windows 10, I see that the memory use every day is higher, so my conclusion is that there is a memory leak in my application.
I found out that it's happening when I call the clsRecorder.StartRecord. For a couple of hours I tried to find where it's happening but I can't find it.
I test it on this way: every second I call clsRecorder.StartRecord and I see the memory use increases. I think there goes something wrong with 'InitWaveInWnd'.
What can cause a memory leak? All objects will be set to nothing. Can it be caused by variable? Has anyone an idee?
To start the recording I use:
Code:
If Not clsRecorder.StartRecord("44100", Val(ini.Stereo) + 1) Then
MsgBox "Unable to start monitoring!", vbExclamation
End If
To stop the recording I use:
Code:
clsRecorder.StopRecord
Download the WaveInRecorder class:
https://www.vbforums.com/attachment....4&d=1298433000
-
Aug 25th, 2022, 03:30 AM
#2
Fanatic Member
Re: WaveInRecorder.cls causes memory leak?
Does it leak on all versions of windows?
-
Aug 25th, 2022, 07:28 AM
#3
Thread Starter
New Member
Re: WaveInRecorder.cls causes memory leak?
 Originally Posted by vbwins
Does it leak on all versions of windows?
Ooh, I don't know. I shall try this on another OS.
Could this be the problem with Windows 10? And is the a solution?
-
Aug 25th, 2022, 08:24 AM
#4
Re: WaveInRecorder.cls causes memory leak?
Do you create a new instance of the class for every call every hour?
Or do you reuse a single instance?
-
Aug 26th, 2022, 12:50 AM
#5
Fanatic Member
Re: WaveInRecorder.cls causes memory leak?
 Originally Posted by nicos
Ooh, I don't know. I shall try this on another OS.
Could this be the problem with Windows 10? And is the a solution?
Don't know. But in 25 years of Windows development I have found various versions leak differently. Its worth isolating. Try something older like 2008.
-
Aug 26th, 2022, 05:26 PM
#6
Thread Starter
New Member
Re: WaveInRecorder.cls causes memory leak?
 Originally Posted by Arnoutdv
Do you create a new instance of the class for every call every hour?
Or do you reuse a single instance?
I do the following:
Code:
Set clsRecorder = Nothing
Set clsRecorder = New WaveInRecorder
And then start the record again:
Code:
If Not clsRecorder.StartRecord("44100", Val(ini.Stereo) + 1) Then
MsgBox "Unable to start monitoring!", vbExclamation
End If
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|