Bryce's Radio Experiments
The Intersection of PDAs, Wireless, Radio, and CSS.

Permanent Link Tuesday, April 02, 2002

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 objNode
    Set 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!

3:33:16 PM | Comments: | Topics: annoyances pda_programming pocketblog 

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.

2:11:30 PM | Comments: | Topics: annoyances pda_programming pocketblog 

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.

2:08:28 PM | Comments: | Topics: pda_convergence pda_palmos 

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...

3:07:02 AM | Comments: | Topics: pda_programming pocketblog 

MSDN Magazine: "Develop Handheld Apps for the .NET Compact Framework with Visual Studio .NET"

12:23:19 AM | Comments: | Topics: dotnet_compact_framework 


© Copyright 2003 T Bryce Yehl Click here to send an email to the editor of this weblog.
Last update: 6/29/2003; 9:34:47 PM.
the