I assumed that when a document was handled by the saxon:stream pseudo-function that the called document was available for garbage collection since the expectation is that the document is only read once.
However, I was fiddling with streaming in one of my scripts and I saw behavior that does comport to the above assumption.
In the stylesheet I use the following command:
<xsl:variable name="session.traces" select="saxon:stream(doc(session.extractor/@file)/student/session/systemTrace)"/>
(This command is used inside a loop that executes hundreds of times. In each call of the loop, a different file is referenced by "session.extractor/@file". These files are about 3M in size.)
This caused the application to run out of memory.