Click here to Skip to main content
15,929,581 members
Home / Discussions / Visual Basic
   

Visual Basic

 
QuestionHow to set a sreen to primary sreen Pin
ba-ju25-Mar-08 23:40
ba-ju25-Mar-08 23:40 
AnswerRe: How to set a sreen to primary sreen Pin
Dave Kreskowiak26-Mar-08 7:02
mveDave Kreskowiak26-Mar-08 7:02 
GeneralRe: How to set a sreen to primary sreen Pin
ba-ju27-Mar-08 3:26
ba-ju27-Mar-08 3:26 
QuestionIVR using SAPI 5.1 and TAPI 3 Pin
Dhara_Remadhara25-Mar-08 22:45
Dhara_Remadhara25-Mar-08 22:45 
GeneralRe: IVR using SAPI 5.1 and TAPI 3 Pin
Dave Kreskowiak26-Mar-08 7:00
mveDave Kreskowiak26-Mar-08 7:00 
QuestionHow run SCP(Secure Connetion Protocol ) In Windows Pin
Aruna Gaddam25-Mar-08 21:24
Aruna Gaddam25-Mar-08 21:24 
GeneralRe: How run SCP(Secure Connetion Protocol ) In Windows Pin
Dave Kreskowiak26-Mar-08 6:59
mveDave Kreskowiak26-Mar-08 6:59 
QuestionMemory Leak in Sub ? Pin
Mitch F.25-Mar-08 20:36
Mitch F.25-Mar-08 20:36 
Hi,

I've narrowed down a memory leak in my application to a single Sub, however, I can't figure out what's doing it. Whenever this Sub is called (SelectedIndexChanged), my memory usage grows by ~100 kb and doesn't go down, according to Task Manager.

Here's my code:

Note:
The following names are Global Variables:
appSelPath
appSelName
appSelAlt
appSelPos
appSelID
canEnable
beenFound

And yes, I need all of these variables as they are used in many other methods within my application.

<br />
        Dim selectedText As String = ""<br />
        If lbApps.SelectedItems.Count = 1 Then<br />
            btnLaunch.Enabled = True<br />
<br />
            pbSel.Image = ilApps.Images(lbApps.SelectedIndex + 1) 'lvApps.SelectedItems(0).ImageList.Images(selImg)<br />
<br />
            selectedText = lbApps.SelectedItem.ToString<br />
            btnLaunch.Text = "Launch " + selectedText<br />
            btnMove.Text = strMoveText.Replace("|", selectedText)<br />
            'Add Application Routine<br />
            If selectedText <> "Add Application..." Then<br />
                'set app selected path<br />
                For i As Integer = 0 To appListing.Count - 1<br />
                    Dim lineData() As String = appListing.Item(i).ToString.Split("|")<br />
                    If selectedText = lineData(0) Then<br />
                        appSelPath = lineData(1)<br />
                        appSelName = lineData(0)<br />
                        If lineData.Length = 3 Then<br />
                            If lineData(2) = "True" Then appSelAlt = True<br />
                        Else<br />
                            appSelAlt = False<br />
                        End If<br />
                    End If<br />
                    Array.Clear(lineData, 0, lineData.Length)<br />
                    lineData = Nothing<br />
                Next<br />
<br />
                Dim enableIt As Boolean = True<br />
                ' Dim appPos As Integer = -10<br />
                For i As Integer = 0 To appLaunched.Count - 1<br />
                    Dim lineData() As String = appLaunched.Item(i).ToString.Split("|")<br />
                    If lineData(1) <> "wait" Then<br />
                        If appSelName = lineData(0) Then<br />
                            enableIt = False<br />
                            If CInt(lineData(1)) > 0 Then<br />
                                appSelPos = CInt(lineData(1))<br />
                                appSelID = CInt(lineData(2))<br />
                                canEnable = True<br />
                            End If<br />
                        End If<br />
                    End If<br />
                    Array.Clear(lineData, 0, lineData.Length)<br />
                    lineData = Nothing<br />
                Next<br />
<br />
                ContextMenuStrip1.Enabled = True<br />
                btnLaunch.Enabled = True <br />
                lbScreens.SelectedItems.Clear()<br />
                If enableIt = False Then<br />
                    lbScreens.Enabled = True<br />
                    btnMove.Enabled = False<br />
                    canEnable = True<br />
                    beenFound = True<br />
                Else<br />
                    lbScreens.Enabled = True<br />
                    btnMove.Enabled = False<br />
                    beenFound = False<br />
                    canEnable = False<br />
                End If<br />
            End If<br />
        End If<br />
        selectedText = Nothing<br />


I have no idea what's wrong. I've looked at this chunk of code for hours now, and it doesn't seem like I'm making any unusual calls to anything.

Any help is appreciated.

Thanks,
Mitch F
AnswerRe: Memory Leak in Sub ? Pin
Christian Graus25-Mar-08 20:55
protectorChristian Graus25-Mar-08 20:55 
GeneralRe: Memory Leak in Sub ? Pin
Mitch F.25-Mar-08 21:07
Mitch F.25-Mar-08 21:07 
GeneralRe: Memory Leak in Sub ? Pin
Christian Graus25-Mar-08 21:23
protectorChristian Graus25-Mar-08 21:23 
GeneralRe: Memory Leak in Sub ? Pin
Mitch F.25-Mar-08 21:34
Mitch F.25-Mar-08 21:34 
GeneralRe: Memory Leak in Sub ? Pin
Christian Graus25-Mar-08 22:18
protectorChristian Graus25-Mar-08 22:18 
GeneralRe: Memory Leak in Sub ? Pin
Dave Kreskowiak26-Mar-08 6:57
mveDave Kreskowiak26-Mar-08 6:57 
AnswerRe: Memory Leak in Sub ? Pin
Guffa26-Mar-08 2:43
Guffa26-Mar-08 2:43 
Questionhow to initialize a database connection for the target computer? Pin
crookshanks25-Mar-08 17:47
crookshanks25-Mar-08 17:47 
GeneralRe: how to initialize a database connection for the target computer? Pin
Christian Graus25-Mar-08 18:48
protectorChristian Graus25-Mar-08 18:48 
GeneralRe: how to initialize a database connection for the target computer? Pin
crookshanks25-Mar-08 19:05
crookshanks25-Mar-08 19:05 
GeneralRe: how to initialize a database connection for the target computer? Pin
Christian Graus25-Mar-08 19:08
protectorChristian Graus25-Mar-08 19:08 
GeneralRe: how to initialize a database connection for the target computer? Pin
crookshanks25-Mar-08 19:40
crookshanks25-Mar-08 19:40 
GeneralRe: how to initialize a database connection for the target computer? Pin
N a v a n e e t h25-Mar-08 19:45
N a v a n e e t h25-Mar-08 19:45 
GeneralRe: how to initialize a database connection for the target computer? Pin
crookshanks25-Mar-08 20:29
crookshanks25-Mar-08 20:29 
GeneralRe: how to initialize a database connection for the target computer? Pin
Christian Graus25-Mar-08 20:30
protectorChristian Graus25-Mar-08 20:30 
QuestionHow to add button in window form datagrid Pin
Eunice (VB junior)25-Mar-08 16:49
Eunice (VB junior)25-Mar-08 16:49 
AnswerRe: How to add button in window form datagrid Pin
Dave Kreskowiak26-Mar-08 6:50
mveDave Kreskowiak26-Mar-08 6:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.