You are viewing limited content. For full access, please sign in.

Question

Question

Memory Leak?

SDK
asked on October 20, 2016


When coding a Visual Studio project with references to Interop.DocumentProcessor92 and Interop.LFSO92Lib,
what values should we use for the properties Embed Interop Types and Specific Version?

I ask because we recently switched from the LF 9.0 versions to the Lf 9.2 versions
and moved my solution from VS 2012 to VS 2015.
The project runs as a Windows Service and I am now getting a memory leak.
Task Manager shows initial memory below 10,000K, but it climbs up over 100,000K in a couple of hours and over 1,200,000K after a couple of days.
The code still works fine, however.

Has anyone seen this happen?  Thanks!

 

 

0 0

Replies

replied on October 20, 2016

Memory leaks are notoriously hard to track down. Those properties are likely not related to the leak. Which SDK classes/methods does your application use?

0 0
replied on October 20, 2016

You might try calling ReleaseComObject explicitly when you are done with a COM object.  I would think that the .Net runtime wouldn't leave objects around for a few days, but it might help.

0 0
replied on October 24, 2016

For tracking down problems like this, it's often helpful to strip your program down to the smallest example that still produces the problem.  If you can do that, you should have something small enough to post here.

0 0
replied on October 25, 2016

Hi guys, thanks for your replies.

I'm doing a lot of testing and have stripped it down.  I have a basic question.

The Laserfiche SDK documentation has only this in the example for the LFConnection.Terminate Method -

      Dim Conn As LFConnection = DB.CurrentConnection
      Conn.Terminate()

In a "real" system, what should also be done with the Conn and DB after that?
Conn = Nothing / probably
DB = Nothing    / probably
Conn.Dispose   / 'dispose' is not a member of 'LFConnection'.
DB.Dispose       / 'dispose' is not a member of 'LFDatabase'.

 

Similarly, what should be done after Conn.Create(DB) to App, Serv and Conn?

Thanks!

0 0
replied on October 25, 2016

Setting the references to nothing is good, but for an object to be eligible for garbage collection there needs to be no references pointing to it.  In order to determine if that's the case, you need to take a higher-level look at your design.

0 0
replied on October 25, 2016

Also, what version of LFSO are you using?  I'm remembering now that there have been some memory leaks that we've fixed that may account for some of what you are seeing.

0 0
replied on October 26, 2016

Hi Brian

We are using Interop.LFSO92Lib.
I did switch to Interop.LFSO10Lib, but some of my custom objects are used in WebLink.
When I tried to change WebLink to Interop.LFSO10Lib, errors occured than I couldn't resolved.
So I had to switch back to Interop.LFSO92Lib.

Could this be the problem?

 

0 0
replied on October 26, 2016

I was able to remove my custom project from WebLink 9.0 and reference Interop.LFSO100Lib from my custom project.

I am rerunning my test right now.

0 0
replied on October 26, 2016

No more memory leak!

I can confidently say that using Interop.LFSO92Lib was causing my problem and that using  Interop.LFSO100Lib solved it.

Brian and Robert, thank you for your time and help!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.