Memory Leak? - DOTNET

This is a discussion on Memory Leak? - DOTNET ; Hello All, I have a simple little prototype application that seems to be consuming resources and memory, and when the application stops processing, no cleanup seems to occur. Basically, what happens is this: 1. A data file is created in ...

+ Reply to Thread
Results 1 to 2 of 2

Memory Leak?

  1. Default Memory Leak?

    Hello All,

    I have a simple little prototype application that seems to be consuming
    resources and memory, and when the application stops processing, no cleanup
    seems to occur. Basically, what happens is this:

    1. A data file is created in a directory, and a FileSystemWatcher fires an
    event that I catch.
    2. In the event handler, I use the ThreadPool.QueueUserWorkItem to process
    the file. The file is XML, with a bunch of records in it. Basically, I
    scan through the file and process each record.
    3. The thread finishes processing the file. At this point, it is a
    prototype, so all the thread is really doing is creating one object for each
    record in
    the file. The object has a bunch of properties, each one representing
    the value of an element in the a single XML record. So if there are
    100 "Items" in the Xml file, there will be 100 objects created. No
    reference is being held to these objects. They are simple newed up nd loaded
    with the parsed data.

    I hold no references to the thread in my main application, yet everytime I
    drop another file in the directory to start the processing, the memory usage
    continues to grow, and is never released. I am making sure to explicitly
    release all object references, there are no circular references that I can
    find.I am closing all files.

    When a thread is finished processing, doesn't it "go away" and return to the
    thread pool? At this point, I would think any objects it had created would
    be garbage collected as well.

    Sorry if this is a newbie topic, but I'm rather new to multithreading, and
    would like to do this right. I hope my description above is clear enough.

    Please respond via newsgroup. Thanks for any help in advance.

    Robert



  2. Default Re: Memory Leak?

    This is a common question, you can google many answers to:
    http://tech-geeks.org/tiny.php?url=2573

    or original URL (watch for wrapping):
    http://groups-beta.google.com/groups...net.*&safe=off

    --
    C#, .NET and Complex Adaptive Systems:
    http://blogs.geekdojo.net/Richard
    "Robert Reineri" <robert123@fnbmarin.com> wrote in message
    news:u8hWDpq7EHA.2452@TK2MSFTNGP14.phx.gbl...
    > Hello All,
    >
    > I have a simple little prototype application that seems to be consuming
    > resources and memory, and when the application stops processing, no
    > cleanup
    > seems to occur. Basically, what happens is this:
    >
    > 1. A data file is created in a directory, and a FileSystemWatcher fires an
    > event that I catch.
    > 2. In the event handler, I use the ThreadPool.QueueUserWorkItem to process
    > the file. The file is XML, with a bunch of records in it. Basically, I
    > scan through the file and process each record.
    > 3. The thread finishes processing the file. At this point, it is a
    > prototype, so all the thread is really doing is creating one object for
    > each
    > record in
    > the file. The object has a bunch of properties, each one representing
    > the value of an element in the a single XML record. So if there are
    > 100 "Items" in the Xml file, there will be 100 objects created. No
    > reference is being held to these objects. They are simple newed up nd
    > loaded
    > with the parsed data.
    >
    > I hold no references to the thread in my main application, yet everytime I
    > drop another file in the directory to start the processing, the memory
    > usage
    > continues to grow, and is never released. I am making sure to explicitly
    > release all object references, there are no circular references that I can
    > find.I am closing all files.
    >
    > When a thread is finished processing, doesn't it "go away" and return to
    > the
    > thread pool? At this point, I would think any objects it had created would
    > be garbage collected as well.
    >
    > Sorry if this is a newbie topic, but I'm rather new to multithreading, and
    > would like to do this right. I hope my description above is clear enough.
    >
    > Please respond via newsgroup. Thanks for any help in advance.
    >
    > Robert
    >
    >




+ Reply to Thread

Similar Threads

  1. Memory Leak in cmd.exe
    By Application Development in forum Software-Testing
    Replies: 2
    Last Post: 04-15-2010, 03:25 AM
  2. TDM memory leak LV 8.5
    By Application Development in forum labview
    Replies: 1
    Last Post: 10-31-2007, 02:10 AM
  3. Will it leak the memory?
    By Application Development in forum C
    Replies: 17
    Last Post: 07-25-2007, 03:52 PM
  4. Re: Flash OCX Memory Leak, Or .Net Framework Memory Leak
    By Application Development in forum DOTNET
    Replies: 0
    Last Post: 03-23-2006, 05:13 PM
  5. What is Memory Leak?
    By Application Development in forum basic.visual
    Replies: 0
    Last Post: 05-24-2005, 12:24 PM