FileUp
Topic: Re: FileUpEE for ASP/ASP.NET Version 5.1.2.58 and memory leak ?

SoftArtisans Forums

Page 1 of 1 (4 items)


Posted by rdm on 10-15-2012 1:21 PM

I am new in this, did not use FileUp before and do not have expirience with this.
Found that FileUpEE for ASP/ASP.NET Version 5.1.2.58 has memory leak [we used profiler to find it]

This is simple code snipet that we are using to transfer file, that is leaking memory :

                using (FileUpEe fe = new FileUpEe())
                {
                    fe.TransferStage = saTransferStage.saWebServer;
                    fe.TransferFile(Context, filePath, fileServerUri);
                }

My question is , does version 5.1.2.58 have known memory leak issue ?
Do we need to use the latest version ?


Posted by Joy_M on 10-16-2012 9:54 AM

There were some memory leaks fixed in version 5.1.0 but we are not aware of any in more recent versions.  Not calling Dispose() could cause problems, but I see you are using a "using" block which should take care of that.  Can you provide more details about what you are seeing?  What is the size of the apparent leak?  We can look into this and get back to you.   

Thanks,

Joy


Posted by rdm on 11-09-2012 4:07 PM

SORRY for late answer.

 

Memory leak reason is :

USING statement will not RELEASE memory of new instance of FileUpEe component

Create WEB app and run next statement in loop [as in my app] and you will see memory leak immediately in windows performance monitor [check private bytes counter] or any memory tool..

 

 

I have simple web test app but could not figure out how to attach zip file on this post ?

 

But it is really loop around USING statement ,exactly as this :

 

 

for (int ii = 0; ii <10000; ii++)
{
       //memory leak is related with init new instance of FileUpEe
        //using statment will not release memory
         using (FileUpEe fe = new FileUpEe())
          {
               fe.TransferStage = saTransferStage.saWebServer;

                   //transfer will not cause memory leak, comment it
                  //fe.TransferFile(Context, incomingFileURL, fileServerUri);
           }
}

 

 

 

 

 


Posted by Joy_M on 11-11-2012 9:16 AM

A using statement should be equivalent to calling Dispose in a finally block which should cause all unmanaged resources to be released.  FileUp includes both managed and unmanaged code.  The .NET part of FileUp will not be cleaned up until the garbage collector actually does a collection.  In a .NET application, it is normal for memory to go up until the next garbage collection, so I don't think just looking at private bytes will tell you anything definitive. You could try calling the garbage collector explicitly in every loop, or you could use a .NET memory profiler that looks deeper into what's happening with memory in the CLR.  Please let us know what you find.

Thanks,

Joy