Memory Leak

S

Shahzad Godil

I am Architect of development of our one Visio based application in VB.Net
2003. So many customer continously reporting memory leak issue in our
application. I am using different profiler to find out which area is
getting memory and then verifying that either it is relelasing properly at
the end of that process.

In going detail, we were able to fix so many issues by implement general
practices for handling Unmanaged code.

Now only one issue is now remaining which is causing memory leak is this.
If you see this code, we are assigning a very large string to our Data1
property of Visio Shape. And now whenever it is assigning, it is never
releasing.

Now seems like as it is changing, visio is keeping this in its undo history.

What I want simply is that whenever I called this method, its changes should
be applied in diagram but it should be include in visio undo history.

Thanks
Shahzad Godil
Karachi-Pakistan.

-----------------------------------------
Dim strString As String

strString = Me.ShapeDomain.GetAsXML.OuterXml

Me.VisioShape.Data1 = strString

strString = Nothing

-------------------------------
 
J

JuneTheSecond

Would you try to use UndoEnabled property, putting your code betweem,
Application.UndoEnabled = False
and
Application.UndoEnabled = True

By the way, in my test in VBA, Undo was disabled not only when UndoEnabled
= False, but also when UndoEnabled = True. I wonder if it is Visio's bug.
When both Application.UndoEnabled = false and Application.UndoEnabled = True
are commented out, undo returned enable.
 
S

Shahzad Godil

I already know this property but this is not my solution. Setting
Application.UndoEnabled to false will purge all my undo history which I
don't want. I want that only my required process should not be inlcude in
undo history without purging previous undo history.

I developed one of our application using AddFlow (3rd party drawing
component) and it has one property to do this same. See its document pasted
text.

Thanks
Shahzad Godil

SkipUndo Property

Description

Determines whether the following actions are recorded in the undo manager.
Not available at design time.

Syntax

object.SkipUndo = value
value = object.SkipUndo

Arguments Description
object Object expression that references an AddFlow control.
value A boolean which determines whether the following actions are
recorded in the undo manager

Default value

False

See Also


Thanks
Shahzad Godil
 
S

Shahzad Godil

I have now implemented this Visio Undo Manager. But its purpose looking
just to keep our external data and drawing sync on undo and redo. My
purpose is different. What my purpose is that I am not dealing with any
external data. What I want simply is that I want my few drawing actions
should not be add in Undo queue.

For example, in clear words. Here is my procedure doing

1. BeginAction
Shape1 Added
End Action

2. Begin Action
.. Shape1.Data1 = "abc" (large text)
End Action

3. Begin Action
Shape2 added
End Action

Now what I want that that Action2 i.e. setting some data in data1 should not
be include in Undo Queue. And whenever I do undo, it should be return to
first Action3 and then Action1 by skipping Action1

Thanks
Shahzad Godil
 
M

Mark Nelson [MS]

Hi Shahzad,

Visio does not support selectively putting things into the undo stack. If
you are manipulating a Visio object and undo is enabled, then Visio will
record the transaction in undo.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
I

Igor [ITP]

Hi.

Maybe You could try to store your large data in a compressed way.(I
don't know if there are some compression libraries for VB cause I'am
using c# in my development). This causes some performance losses for
your application, but maybe it is better than memory leaks. As long as
there are no binary data in your XML it should not be a problem. (I'am
not familiar with the undo functions of visio so this memory leak
problem could still occure. If this solution really helps can only be
figured out through testing...)

Igor Markov
Visio Plugin Developer
Hi Shahzad,

Visio does not support selectively putting things into the undo stack. If
you are manipulating a Visio object and undo is enabled, then Visio will
record the transaction in undo.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Memory Leak in Visio 0
OutOfMemoryError 3
Flash file in visio 0
Memory leak in Office 2008? 28
Memory Leak in Outlook 2007 3
VisUICmds.visCmdInsertClipArt 1
Memory Leak in Outlook 2007? 5
Outlook 2007 memory leak 8

Top