Thread: Memory Leaks
View Single Post
  #1  
Old 24-03-2014, 07:01
VyperOne VyperOne is offline
Member
 
Join Date: Feb 2003
Posts: 37
Default Memory Leaks

I currently develop an application in VB.NET and in one part of the app it repeats a find and replace. The method used is CorelDRAW.Page.TextReplace

After each iteration I can see via Task Manager memory being consumed by this method.

Unfortunately closing the document after the process has completed does not release the memory thereby requiring the user to close CorelDRAW completely to reacquire the spent memory.

Since I can clearly see the issue is with the method itself and not in my code I am posting this here in the hopes someone from Corel could address it.

You can replicate this by simply putting the method in a loop, like below:
(Make sure you have one line of text on your page with the number zero as the text)

Code:
    Sub ProveMemoryLoss()
        Dim iFindString As String = ""
        Dim iCounter As Integer = 0
        Dim CorelPage As CorelDRAW.Page
        Dim cApplication As CorelDRAW.Application
        cApplication = New CorelDRAW.Application
        CorelPage = cApplication.ActiveDocument.ActivePage

        For iCounter = 1 To 10000
            CorelPage.TextReplace((iCounter - 1).ToString, iCounter.ToString, False)
        Next

    End Sub
This problem isn't a big deal when you are only using it a few times but when you have a customer using it to produce 500 to 1000 lines of text it make Corel unstable on low memory hardware.

Any comments or suggestions welcomed. What I need is a way to get this fixed by Corel...
Reply With Quote