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

  • Swimming Upstream

    There are too many things being recalcitrant right now. Eventually, there will be a breakthrough, but this was apparently not the day for it. Let's…

  • We'll Just Keep Counting Down to Zero

    We got far less accomplished than we might have hoped this weekend. On the other hand, I think we're collectively in a better mood, so I'm going to…

  • Wiring It Up

    We are now in the final phases of the kitchen renovation. There's a small bit of trim and some spackling and touch up painting that needs to be done…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded