Results 1 to 4 of 4

Thread: Memory Problem

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jan 2000
    Location
    Mobile, AL
    Posts
    16

    Post

    I know if I create an object with the new keyword I must set it to nothing when I'm done with it.
    I have written a program that reads from a flat ASCII file and writes to a FoxPro database. This program uses ado for file manipulation.
    This progam works on a timer and is set to run every 5 seconds. Each time it processes records the memory usage goes up. Eventually the program gets out of memory errors.
    Is there anything else besides objects that need to be set to nothing? I am not using arrays but have a few Global variables and a user defined type which acts as a record set for the ASCII file.
    For example:

    Global ExportFile as Export
    Type Export {
    name as string
    age as integer
    ssn as string
    }

    When I use it, I do something like this
    ExportFile.name = stName
    or
    rs.fields("Name").value = ExportFile.name


  2. #2
    Former Admin/Moderator MartinLiss's Avatar
    Join Date
    Sep 1999
    Location
    San Jose, CA
    Posts
    33,431

    Post

    You don't need worry about variables. You do need to worry about any object you create, including forms (by loading them) and recordsets. Both should be set to Nothing.

    ------------------
    Marty
    What did the fish say when it hit the concrete wall?
    > > > > > "Dam!"

  3. #3
    Frenzied Member
    Join Date
    Aug 1999
    Location
    Santa Clara, Ca , 95058
    Posts
    1,105

    Post

    Sounds like you're not setting your recordset object to nothing when you finish with it...

  4. #4
    Hyperactive Member Al Smith's Avatar
    Join Date
    May 1999
    Location
    Marcellus, MI. USA
    Posts
    330

    Post

    Hi,
    This sounds very similar to a problem I had when pulling data from our mainframe's database. After about 30 records were retrieved my system would hang up. Using the resource meter I saw the memory drop after each retrieval.
    Putting a DoEvents after each record retrieval solved this.
    Al.


    ------------------
    A computer is a tool, not a toy.
    <A HREF="mailto:[email protected]
    [email protected]">[email protected]
    [email protected]</A>

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