users@jaxb.java.net

Re: partial marshalling?

From: Ryan Shoemaker - JavaSoft East <Ryan.Shoemaker_at_Sun.COM>
Date: Wed, 15 Oct 2003 13:30:26 -0400

Corbett.Klempay_at_trilogy.com wrote:

>
> I've skimmed the archives a bit, but I'm not sure that any of it
> directly addresses if/how you could/couldn't/should partially marshal.
> We currently are building the whole wrapper object tree (fairly
> hierarchical rather than flat) at once and then serializing it all at
> once. However, we just found about some future input data set changes
> that might result in the output tree being MUCH larger...as in perhaps
> bumping up against the heap max. Given that my tree is just something like
>
> ----A
> -----A1
> -----A2
> -----B
> ------B1
> ------B2
> -------b1
> .
> .
> .
>
> ...is it possible to build the part of the tree for the 'A' branch,
> marshal that, and then repeat the process with the next toplevel branch
> (B), such my max memory requirements are (roughly) equal to the size of
> the largest branch/chunk?
>

It sounds like your problem is holding the entire content tree in memory.
If that's the case then it doesn't look like marshalling subtrees is going
to completely solve your problem. As you suggested, you can unmarshal parts
of the document and then marshal them back out - take a look at the partial
unmarshal sample app[1] to see if the pattern works for your case.

Thanks,

--Ryan

[1] $JWSDP_HOME/jaxb/samples/partial-unmarshalling/

> ---
> Corbett J. Klempay
> Trilogy
> 512.874.5176 (W) | 512.750.1372 (C)
> corbett.klempay_at_trilogy.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net