Web Service Method retunrs list of DOM elements, is it holding it in memory
I used wsimport to create proxy classes to be used by the web services client. One of the methods in the classes returns a List<Element> where Element is org.w3c.dom.Element, if I reference a pointer to the List<Element> , will it be holding all the elements in the list in memory, or will bring the data to the client side only when I access the data in each element and be garbage collected when the reference to each element is out of scope ?.
This is because the List potentially has a very large number of elements and we would prefer to stream in each result to control the jvm memory use.