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

  • One of Those Days

    Overall, it might have been better to stay in bed today, but that wasn't really an option. I am still slogging through a problem at work. I'm going…

  • Comcast At Work

    So we went to watch some TV that we'd recorded on our Comcast X1 DVR and discovered that -- overnight! -- we had gone from less than 50% full to over…

  • Tired

    I hit the wall late this afternoon. Sleep will follow soon now, but I needed to finish going through the APBA cards for next season. In other news,…

  • Post a new comment


    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded