Hi list,
during the development of the WCS, we enabled also the WMS to render
GridCoveragesD objects by wrappig them inside a feature and passing
them to the LiteRenderer2D.
Everything was working fine, but I noticed an high memory consumption
when rendering big GridCoverage2D objects. Aat the beginning I did not
care much about it but then I spent a few days doing memory debugging
and I noticed that there were a lot of loitering objects in memory,
mainly of type GC2D which were retaining alot of memory.
Well it turned out that problem was in using the WMSMapContext.
In class GetMapResponse, method public void execute(Request req) you
instantiate an object of type WMSMapContext, you add all the requested
layer, you render them and then you write the results to the output.
Well, the sequnce is fine but the cleaning code is wrong. To avoid
memory leaks beofre the end of the method ypu need to add the
following code,
map.clearLayerList();
in order to clean all the layers of the map and all the listeners
associated to it. between which by the way there is the map itself!
f you forge to do this, you will loose any reference to the created
WMSMapContext n you program but it will be still there in memory
because of the listeners.
To avoid future problems, please fix this bug.
Simone.