Results 1 to 7 of 7

Thread: Free all memory from program?

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259

    Free all memory from program?

    I am working on a program that is memory-intensive, and although I will be going through trying to make it as effecient as possible, I believe it will still use a lot. It will need the ability to restart, and therefore *basically* perform the same thing with different data again.

    Is there anyway I can "clear" all data from the memory currently associated with the program, or ANYTHING that would help me out... thanks!
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  2. #2
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    This is somewhat vague...

    Are you using arrays?

    VB Code:
    1. Erase ARRTEMP

    Unload All Form when Exiting program

    VB Code:
    1. Dim Frm as Form
    2.  
    3. For Each Frm in Forms
    4.  
    5. Unload Frm
    6.  
    7. Set Frm=Nothing
    8.  
    9. Next
    10.  
    11. End

    Are you using connections and recordsets (databases access)

    VB Code:
    1. Rst.Close
    2.  
    3. Cnn.Close
    4.  
    5. Set Rst = Nothing
    6.  
    7. Set Cnn = Nothing

    Wher rst is your recordset object, and cnn is your connection string object...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    Actually, it is a module that has rougly 25+ variables, is there anyway I could, in theory "erase" the module then reload it?

    Thanks for your help so far, it has gotten me someway...
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  4. #4
    Frenzied Member wpearsall's Avatar
    Join Date
    Feb 2002
    Location
    England / UK
    Posts
    1,065

    Re: Well

    Originally posted by James Stanich

    Are you using arrays?

    VB Code:
    1. Erase ARRTEMP
    Just wondering..

    I split my "Retrieved Data" from a "Winsock1" control, into:

    DataArray()

    I Can get rid of everything in "DataArray()" by:

    VB Code:
    1. Erase DataArray()
    2. ' OR
    3. Erase DataArray(0) ' (1) (2) ETC
    , And you have to close record sets too, before you:
    VB Code:
    1. Set myrs = Nothing
    ?

    : Learn something everysecond here huh
    Wayne

  5. #5

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    Nice to know... but does anyone have any info on how I can like quickly erase 25+ variables from the ram!?
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

  6. #6
    PowerPoster
    Join Date
    Aug 2000
    Location
    IN SILENCE
    Posts
    6,441

    Well

    Are the global variables, form level, or procedure level?

    Seeting frm = Nothing should release from and procedure level. Globals I never could get confirmation on how to perform, so I used arrays whenever possible...
    Remaining quiet down here !!!

    BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....

  7. #7

    Thread Starter
    Hyperactive Member
    Join Date
    Sep 2002
    Posts
    259
    I have variables on different scopes, I just want to free up as much ram as possible whenever possible.
    SonicMailer Pro
    The best mailing list manager has just gotten better!
    Click here for a full list of features!

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