Results 1 to 6 of 6

Thread: WaveInRecorder.cls causes memory leak?

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2019
    Posts
    6

    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

  2. #2
    Fanatic Member
    Join Date
    Mar 2019
    Posts
    515

    Re: WaveInRecorder.cls causes memory leak?

    Does it leak on all versions of windows?

  3. #3

    Thread Starter
    New Member
    Join Date
    Sep 2019
    Posts
    6

    Re: WaveInRecorder.cls causes memory leak?

    Quote Originally Posted by vbwins View Post
    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?

  4. #4
    PowerPoster Arnoutdv's Avatar
    Join Date
    Oct 2013
    Posts
    6,734

    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?

  5. #5
    Fanatic Member
    Join Date
    Mar 2019
    Posts
    515

    Re: WaveInRecorder.cls causes memory leak?

    Quote Originally Posted by nicos View Post
    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.

  6. #6

    Thread Starter
    New Member
    Join Date
    Sep 2019
    Posts
    6

    Re: WaveInRecorder.cls causes memory leak?

    Quote Originally Posted by Arnoutdv View Post
    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
  •  



Click Here to Expand Forum to Full Width