Bill Roper (billroper) wrote,
Bill Roper

My Head Hurts

This is possibly because I'm coming down with the strep infection that daisy_knotwise just got diagnosed today. (And she now has antibiotics. If my throat is sore tomorrow, I'll be looking for some myself.)

But the more likely cause of my headache is that I have, I think, figured out the multiple sources of our massive memory leaks.

Every call that we made to the MSXML interface leaked, because the fellow who wrote the wrapper for the interface didn't write virtual destructors for the base classes in his XML DOM Factory class. As a result, when you deleted the pointer to the base class, you did not delete the derived class that held the _com_ptr_t that was wrappering the COM interface classes for MSXML. A massive memory leak followed.

In many places in our code, we were assigning BSTR pointers to _bstr_t wrappers instead of attaching them. As a result, the BSTRs were never deleted. A massive memory leak followed.

And we did the same thing in the JNI interface, but added the sin of allocating BSTRs with the wrong function, making extra copies of BSTRs, etc. I think the JNI interface leaked every string that passed through it. It may have leaked some of them twice. A massive memory leak followed.

I just finished rebuilding the JNI with what I believe are the fixes to the BSTR handling.

We'll see how it does...
Tags: health, home, microsoft, musings, work

  • Happy Birthday, Gretchen!

    And here it is, Gretchen's birthday again. Most of the festivities were last night, due to K's being in the school play tonight, so we had a good…


    I am in a maze of twisting JARs, all alike, except that some work and some don't.

  • Putting Things To Bed

    I think I managed to put a lot of things to bed today at work, which means that I should be able to go work on something else. Except for the…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded