Opening documents gets slower each time  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Vasyl-Tracker Dev Team, Sean - Tracker, Paul - Tracker Supp, Chris - Tracker Supp, Tracker Supp-Stefan, Ivan - Tracker Software

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
mash_inc
User
Posts: 37
Joined: Tue Jan 25, 2011 3:11 pm
Location: Germany
Contact:

Opening documents gets slower each time

Post by mash_inc » Wed Feb 22, 2017 1:21 pm

The time it takes to open a documents gets longer each time.
I created a WPF demo application so that you can easily see what I mean.

Just click on the "Open 20" button several times and whatch how the "ellapsed milliseconds" increase.

Is there something else that needs to be done to when closing an editor?
E.g. Is it required to call Dispose() at some point?

The Demo App can be downloaded here:
https://onedrive.live.com/?id=5E93A6A62 ... A622DFFE84

Best regards
Tino

PS: I just create a Winforms DemoApp with the same results.

User avatar
Sasha - Tracker Dev Team
User
Posts: 4584
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Opening documents gets slower each time

Post by Sasha - Tracker Dev Team » Wed Feb 22, 2017 3:05 pm

Hello Tino,

There are plenty of handles left after each execution of the "Open 20" command. And when you are opening the document, you are creating new control each time in the same process - I'm afraid you cannot manage the release of everything correctly by using C#. Probably you should rethink the logic so you would not create/destroy multiple controls each time.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

mash_inc
User
Posts: 37
Joined: Tue Jan 25, 2011 3:11 pm
Location: Germany
Contact:

Re: Opening documents gets slower each time

Post by mash_inc » Wed Feb 22, 2017 4:03 pm

Hi Alex,

thanks for your answer.

But that's what we did with the old viewer and it worked fine. We simply called Dispose() on each Viewer to terminate it's according process.
And it is also the behaviour of our application for many years now, to open multiple PDFXControls, each in it's own tab page.

Since it has always been possible to open several controls at the same time (and still is), there should be a way to close each control entirely without leaving back open handeles or something else.

Please take a look at the video here to get an impression of what our app does with your editor:
https://onedrive.live.com/?id=5E93A6A62 ... A622DFFE84

Can you please offer a solution or a workarround for this.

Thanks in advance
Best regards

Tino

User avatar
Sasha - Tracker Dev Team
User
Posts: 4584
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Opening documents gets slower each time

Post by Sasha - Tracker Dev Team » Fri Feb 24, 2017 10:03 am

Hello Tino,

One of our lead devs will look at this one when he has time.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

mash_inc
User
Posts: 37
Joined: Tue Jan 25, 2011 3:11 pm
Location: Germany
Contact:

Re: Opening documents gets slower each time

Post by mash_inc » Fri Feb 24, 2017 10:34 am

Hi Alex,

OK thanks, than we have to wait.

I want to add, that we have use cases where our application runs 24/7, without getting restarted for days.
In this cases the performance loss gets significant after a few days.

Best regards
Tino

User avatar
Sasha - Tracker Dev Team
User
Posts: 4584
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Opening documents gets slower each time

Post by Sasha - Tracker Dev Team » Fri Feb 24, 2017 11:42 am

Hello Tino,

We will try to investigate this issue and hopefully find a suitable solution.

Cheers,
Alex
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13787
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Opening documents gets slower each time

Post by Tracker Supp-Stefan » Fri Feb 24, 2017 12:00 pm

Hello Tino,

Just had a chat with Sasha - he was not able to reproduce the Crash, but was able to reproduce the other issue. Can you please let us know the exact build of the Editor you are currently using?

Regards,
Stefan

mash_inc
User
Posts: 37
Joined: Tue Jan 25, 2011 3:11 pm
Location: Germany
Contact:

Re: Opening documents gets slower each time

Post by mash_inc » Fri Feb 24, 2017 12:18 pm

Hi Stefan,

we are using the 6.0.320.1.
This version of the PDFXEditCore.x86.dll was also included in my Demo app posted above.

https://onedrive.live.com/?id=5E93A6A62 ... A622DFFE84

Best regards
Tino

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13787
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Opening documents gets slower each time

Post by Tracker Supp-Stefan » Fri Feb 24, 2017 1:30 pm

Thanks Tino,

We are now waiting for a colleague from the head office (Western Canada, Pacific Time Zone) to look at this, and we will post again as soon as we have further info!

Regards,
Stefan

cew
User
Posts: 209
Joined: Tue Feb 01, 2011 8:14 am

Re: Opening documents gets slower each time

Post by cew » Fri Mar 03, 2017 12:47 pm

Hi,
mash_inc wrote:Is there something else that needs to be done to when closing an editor?
E.g. Is it required to call Dispose() at some point?
Is there any information on these questions in the described use?

Best regards,
cew

User avatar
Tracker Supp-Stefan
Site Admin
Posts: 13787
Joined: Mon Jan 12, 2009 8:07 am
Location: London
Contact:

Re: Opening documents gets slower each time

Post by Tracker Supp-Stefan » Fri Mar 03, 2017 12:58 pm

Hello Cew, Tino,

I am afraid that I've not received any feedback from the colleague that has to look at this. I will request an update once again now.

Regards,
Stefan

User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 1957
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: Opening documents gets slower each time

Post by Vasyl-Tracker Dev Team » Sat Mar 04, 2017 12:17 am

Hi, Tino.

I investigated your sample from:

https://onedrive.live.com/?id=5E93A6A62 ... A622DFFE84

and made some important changes in it (here: http://www.docu-track.co.uk/WPFDemoApp.RegFree.zip):

1. added code that initializes/uninitializes our ActiveX SDK only once, please check:

MainWindow::MainWindow()
MainWindow::OnWindowClosed

- without it the SDK automatically initializes itself on creation of first pdf-control and uninitializes on disposing of last pdf-control - that will significantly slow down the normal user's work.

2. in MainWindow::CloseAllOpenDocuments() I changed the "userControl.CloseDocument()" to the "userControl.Dispose();"
The just "userControl.CloseDocument()" isn't enough because the user-control remains alive even corresponding tab is closed. I guess - because corresponding WindowsFormsHost-container(that is parent for the user-control) - remains alive too. It looks like that disposing of TabItem-object doesn't destroy the TabItem.Container object (that is WindowsFormsHost-container)..

As result - the fixed sample working well without annoying slowdown effect.

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.

mash_inc
User
Posts: 37
Joined: Tue Jan 25, 2011 3:11 pm
Location: Germany
Contact:

Re: Opening documents gets slower each time  SOLVED

Post by mash_inc » Mon Mar 06, 2017 3:25 pm

Hi Vasyl,

thank you very much for your help.

The Dispose() on the Editor does the trick :D
I am a bit surprised about that, because we tried this a few days ago with no success, hmm :roll:
And as I mentioned, we did exactly that with the old viewer. But who cares, we are happy that it works now.

We also had the guess that something happens when opening the first and closing the last control.
Therefore, since a few days we start an invisible viewer and hold it open for the whole lifetime of the application. This also solved some performance and handling issues.

Thanks again.

Best regards
Tino

User avatar
Sasha - Tracker Dev Team
User
Posts: 4584
Joined: Fri Nov 21, 2014 8:27 am
Contact:

Re: Opening documents gets slower each time

Post by Sasha - Tracker Dev Team » Mon Mar 06, 2017 4:10 pm

:)
Join us at Google+:
https://plus.google.com/+PDFXChangeEditorTS
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ

Post Reply