| April 2002 | ||||||
| Sun | Mon | Tue | Wed | Thu | Fri | Sat |
| 1 | 2 | 3 | 4 | 5 | 6 | |
| 7 | 8 | 9 | 10 | 11 | 12 | 13 |
| 14 | 15 | 16 | 17 | 18 | 19 | 20 |
| 21 | 22 | 23 | 24 | 25 | 26 | 27 |
| 28 | 29 | 30 | ||||
| Mar May | ||||||
This site is no longer maintained.
My current weblog.
Embedded Visual Hell: Solution!
Loading XMLDOM with an XML document that already contains the root element, as opposed to programatically appending the root element to a blank XML document, appears to have solved the memory leak problem. Here's the sample code:
Private Sub noMoreMemoryLeak()
Dim objDOM, objRoot, objNode' objOSIW32 is a global reference to OSIUtil.Win32, work-around for
' native CreateObject memory leak.
Set objDOM = objOSIW32.CreateObject("Microsoft.XMLDOM")' pre-load XML document containing only the root element.
objDOM.loadXML "<rootElement/>"
Set objRoot = objDOM.documentElement
Set objNode = objDOM.createElement("childElement")
objRoot.appendChild objNodeSet objNode = Nothing
Set objRoot = Nothing
Set objDOM = Nothing
End Sub
There are no further leaks when creating new elements and appending them to the root element or it's children. Sweet. This is the sort of hack that I don't mind implementing...
Keeping my fingers crossed that the .NET Compact Framework and Smart Device Extensions won't be so damned buggy!
I figured out a scenario in which XMLDOM will not leak memory when appending elements, have to work up another set of tests to see if that knowledge can be turned into a practical implementation for Mobile Offline Blogger.Treo @ CompUSA
Was at my local CompUSA this morning, and saw that they have the Treo 180 in stock. It's a bit smaller than I thought: about as tall as my Nokia 8210, roughly 2/3rd's wider, and just a bit thicker due to the flip-up part. Not too bad, but still too big for my belt. They didn't have it powered, so I could not do much more than touch it. The keys seemed really tiny, I had trouble pressing just one key (I have no such problems with the Zaurus).
Dan Bricklin's review made the important point that the device has an algorithm to figure out which key you intended to press. That feature is absolutely necessary.
I've expanded my plea for help from Devbuzz to Usenet. Brings back memories...
For now I'm just going to move on to other portions of Mobile Offline Blogger, as there is still plenty of work to be done. If an appropriate solution doesn't present itself shortly, Beta 1 will leak memory to the tune of +/- 270KB per posted weblog entry.
With Beta 2, all of the XML-RPC calls could be migrated to an external application which would exit upon completion. Since the memory that XMLDOM leaks is freed when the application exits, there would no longer be an issue. I take issue with having to implement nasty hacks such as this, but sometimes there are no alternatives...
MSDN Magazine: "Develop Handheld Apps for the .NET Compact Framework with Visual Studio .NET"