possible memory leak in quantlib addin

Posted by P Nelnik on
URL: http://quantlib.414.s1.nabble.com/possible-memory-leak-in-quantlib-addin-tp782.html

Good morning all,

Recently I was looking at the results in the Option.xls sheet that comes with the quantlib xll installation.
By default it is located:  C:\Program Files\QuantLibXL\Workbooks\StandaloneExamples\Option.xls

If I recalc the sheet a few times I see that handles change for example european_option#3706 becomes european_option#3707
which is all fine. However I noticed that I then type european_option#3706 into a cell, I would expect that the handle would be no longer valid and so I would expect not to be able to use it again. But to my surprise the handle still worked.
This to me looked like a possible memory leak. I.e. old handles are not being deleted.

To test it, I wrote the following VBA:
Option Explicit

Sub calc_forever()
    ' This can be used to check for the presence of memory leaks.
    ' The sheet is recalculated multiple times, if there is a memory leak,
    ' then the process size will grow.
    '
    ' To terminate type: Ctrl+Break
    While True
        Application.CalculateFull
    Wend
   
End Sub

When I left the sheet recalcing for a while (20min) I did indeed see the process size grow steadily, (though not spectacularly).
This is further evidence of the memory leak.

In my experience, when handles in excel are properly implemented, sheets can be left recalculating thousands of times over hours or days and the process size won't grow.

Regards
Philip



------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev 
_______________________________________________
QuantLib-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quantlib-users