What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » Memory Useage In VB

Memory Useage In VB
Author: Message:
DJeX
Veteran Member
*****

Avatar


Posts: 1138
Reputation: 11
– / Male / –
Joined: Jul 2003
O.P. Huh?  Memory Useage In VB
I'm making a program in VB that will display the netstats of your computer. Every time it updates it stores the information in memory. Which every 5 seconds raises the program memery useage by 24bytes. I no it may seem like not much but when this program is ment to run when you start your computer and run in the background, 24 bytes adds up. So I need to know how to clear the memory of the information I've stored in it. Heres my code that adds the info in the memory.

code:
Public Sub RefreshStack()
Dim i As Long
    pDataRef = 0

For i = 0 To nRows '// read 24 bytes at a time
    CopyMemory nState, ByVal pTablePtr + (pDataRef + 4), 4
    CopyMemory nLocalAddr, ByVal pTablePtr + (pDataRef + 8), 4
    CopyMemory nLocalPort, ByVal pTablePtr + (pDataRef + 12), 4
    CopyMemory nRemoteAddr, ByVal pTablePtr + (pDataRef + 16), 4
    CopyMemory nRemotePort, ByVal pTablePtr + (pDataRef + 20), 4
    CopyMemory nProcId, ByVal pTablePtr + (pDataRef + 24), 4

    DoEvents

        'If nRemoteAddr <> 0 Or nRemotePort <> 0 Or nLocalPort <> 0 Then
            Connection(i).State = nState
            Connection(i).LocalHost = nLocalAddr
            Connection(i).LocalPort = nLocalPort
            Connection(i).RemoteHost = nRemoteAddr
            Connection(i).RemotePort = nRemotePort
            Connection(i).ProcessID = nProcId
            Connection(i).ProcessName = GetProcessName(nProcId)
           
        'End If
        pDataRef = pDataRef + 24

        DoEvents
        Next i
       


End Sub


Now how do I clear or remove the data so I can keep my memory free for other programs to use. And so it don't hog all the memory.

Thanks!

This post was edited on 08-29-2004 at 07:18 AM by DJeX.
[Image: top.gif]
08-29-2004 07:17 AM
Profile PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Memory Useage In VB - by DJeX on 08-29-2004 at 07:17 AM
RE: Memory Useage In VB - by theRabbit83 on 08-29-2004 at 08:28 AM
RE: Memory Useage In VB - by DJeX on 08-29-2004 at 07:40 PM
RE: Memory Useage In VB - by Choli on 08-29-2004 at 08:58 PM
RE: Memory Useage In VB - by DJeX on 08-29-2004 at 09:04 PM
RE: Memory Useage In VB - by Choli on 08-29-2004 at 09:23 PM
RE: Memory Useage In VB - by DJeX on 08-29-2004 at 11:59 PM
RE: Memory Useage In VB - by Choli on 08-30-2004 at 09:23 PM
RE: Memory Useage In VB - by DJeX on 09-01-2004 at 05:17 AM
RE: Memory Useage In VB - by Choli on 09-01-2004 at 08:02 PM
RE: Memory Useage In VB - by DJeX on 09-02-2004 at 03:48 AM


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On