Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults.
From: Mark Nelson [MS] (marknel_at_online.microsoft.com)
Date: 04/21/04
- Next message: AA: "Help needed in visio"
- Previous message: jamiescot_at_su.shawcable.net: "Lola Eurobabe getting her tits out"
- In reply to: Joseph Gasiorek: "Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults."
- Next in thread: Joseph Gasiorek: "Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults."
- Reply: Joseph Gasiorek: "Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults."
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 20 Apr 2004 23:19:56 -0700
I believe the culprit here is garbage collection under .NET. Visio uses an
internal object list to track objects for automation. In COM programming,
releasing an automation object causes an immediate release from the internal
list. In .NET programming, the object doesn't go away until garbage
collection takes place. This can dramatically extend the lifetime of these
objects and result in the type of memory consumption you are seeing. I
believe the prescribed workaround is to force garbage collection to take
place, though this goes against the .NET philosophy of managed code.
-- Mark Nelson Microsoft Corporation This posting is provided "AS IS" with no warranties, and confers no rights. "Joseph Gasiorek" <josephtsg@hotmail.com> wrote in message news:2d705f30.0404201004.3fc31b3@posting.google.com... > josephtsg@hotmail.com (Joseph Gasiorek) wrote in message news:<2d705f30.0404190924.f4203dc@posting.google.com>... > > I have placed the Visio ActiveX control on a form in .Net and I have a > > timer that triggers every 100 m.s. > > > > When the Application initializes: > > 1) load a document > > 2) Disable UNDO,EVENTS, and AutoRecovery. > > 3) Close down all unwanted windows > > > > On the timer Tick: > > 1)Generate new values to update 3 shapes on the active page. > > 2)Configure all parmeters for a SetResult call on the page > > 3)Disable App.ScreenUpdating > > 4)call SetResults > > 5)Enable App.ScreenUpdating > > 6)Use Marshal.ReleaseComObject(object), where objects are created for > > manipulation of the page, application (in an attempt to clean up > > memory -- it behaves the same way with out this) > > > > If I run this exe, you can see the Memory usage gradually increase (in > > task manager). So after 30 minutes my memory goes from 41meg to > > 75meg, and keeps climbing. > > > > This is the first time I have used the control, I have had tremendous > > success in doing a similar thing in a 2002 VSL. Has any one else seen > > this memory usage? > > > > Anyone have any ideas? > > I have investigate this more and found that a SetResults(that changes > 3 cell values) or 3 seperate calls to the cells.ResultIU cause massive > page faults. By commenting out only the set result or 3 seperate > calls, then no page faults exist and the application is well behaved. > > So why do writes that update the drawing cause page faults?
- Next message: AA: "Help needed in visio"
- Previous message: jamiescot_at_su.shawcable.net: "Lola Eurobabe getting her tits out"
- In reply to: Joseph Gasiorek: "Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults."
- Next in thread: Joseph Gasiorek: "Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults."
- Reply: Joseph Gasiorek: "Re: 2003 ActiveX control in .NET consumes memory when page is updated with setResults."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|