Bill Roper (billroper) wrote,
Bill Roper
billroper

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
Subscribe

  • Time for Rebuilding

    Well, there's nothing like research. Having determined that DDR5 is going to carry a substantial price premium over DDR4 memory for at least a year…

  • Driven Wild

    The studio computer continues to misbehave in various ways. When I fired up Cubase today, I got a lot of nasty, blocky video, despite having cleaned…

  • Some Old Doggerel

    I recall having mangled a CSN tune many years ago on the way to Contraption. Like that convention, the particular co-worker whose code I was digging…

  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 2 comments