Memory issues

Add-in Express™ Support Service
That's what is more important than anything else

Memory issues
 
Todd Price




Posts: 14
Joined: 2014-08-13
We're having memory issues show up after the first or second time our toolbar module code is executed, and I'm looking at possibly releasing the IE application after our code succeeds. This code successfully releases IE:


                System.Runtime.InteropServices.Marshal.FinalReleaseComObject(this.IEObj);


Is it possible to manually recreate this reference?
Posted 07 Jan, 2015 22:20:51 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Todd,

Releasing that object is incorrect since Add-in Express relies on it. There's no way to recreate it.


Andrei Smolin
Add-in Express Team Leader
Posted 08 Jan, 2015 02:18:30 Top
Todd Price




Posts: 14
Joined: 2014-08-13
Is there a way to instead "reboot" add-in-express, or force reload my module entirely?
Posted 08 Jan, 2015 08:27:56 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Todd,

It's impossible. I think you are on a wrong track. Could you please describe the issue you are having?


Andrei Smolin
Add-in Express Team Leader
Posted 09 Jan, 2015 04:16:17 Top
Todd Price




Posts: 14
Joined: 2014-08-13
Our add-in takes screen captures of web pages and stores the underlying HTML source and DOM as well. The issue is that after a few captures, retrieving the DOM like this:


                currentSnapshot.Dom = this.HTMLDocument.documentElement.outerHTML;


...throws an exception related to memory. It works fine the first time, every time. But eventually, the process (user navigates, initiates page capture, code scrolls, code takes screen shots, code accesses DOM) throws an exception on this line above. I've tried late-binding as well:


                   object doc = this.HTMLDocument.documentElement;
                   var html = doc.GetType().InvokeMember("outerHTML", BindingFlags.GetProperty, null, doc, new object[] { });


...but this fails the same way.

Thoughts on how to alleviate this?
Posted 09 Jan, 2015 10:13:47 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
Hello Todd,

Does this occur on a certain web site only? if so, the pages may have a problem in their HTML. Also, this may be caused by your code. Could you try to refresh the browser after your add-on "takes screen captures of web pages and stores the underlying HTML source and DOM as well"?


Andrei Smolin
Add-in Express Team Leader
Posted 12 Jan, 2015 07:45:26 Top
Andrei Smolin


Add-in Express team


Posts: 18793
Joined: 2006-05-11
I should have said: "call IEApp.Refresh()", not "refresh the browser".


Andrei Smolin
Add-in Express Team Leader
Posted 12 Jan, 2015 08:15:51 Top