Memory usage grows roughly rapidly and monotonically. Since the original post, I have modified the Win32::OLE module on my machine to also delete the SAFEARRAY associated with Variants that have the VT_ARRAY and VT_BYREF flags set. Of course this contravenes the appropriate usage of the VT_BYREF, but when I use that module with this code, the memory usage is stable.

So it seems to me that it is possible to create a variant with the VT_BYREF flag that is the actual owner of the data. This should not be the case, as the whole idea of the VT_BYREF is that some other data structure owns the data and will take care of its cleanup


In reply to Re^2: Avoiding Memory Leaks with Win32::OLE (what leaks) by vpmeister
in thread Avoiding Memory Leaks with Win32::OLE by vpmeister

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.