> -----Original Message-----
> > These image has a metadata which is massive, and results in 
> allocating 
> > a ton of memory for it. What I see in a memory dump:
> >
> >     9:         88107        4933992  
> javax.imageio.metadata.IIOMetadataNode
> >
> > 5MB only of the IIOMetadataNode class, and we still have to add its 
> > contents, wow.
> >
> 
> So, IIUC, although the image is 20Mb on disk, it will take 
> more memory to geoserver to process it. How could I have a 
> rough amount of memory needed? Is it somewhat like metadata 
> memory + (nro of tiles * memory for each tile)?

Most people will guess it is a memory-leak but unfortunatly IIOMetadataNode is 
not very memory-friendly. It creates an ArrayList of attributes even if there 
are none. This is bad because ArrayList preallocates a lot of memory for 
expected entries. In one of our cases there was over 100 000 empty arraylists 
for one file. 

I'm preparing a bug-report and patch to JDK for, but at the moment there are 
two choices, don't keep the nodes around or provide an alternate implementation 
of IIOMetadataNode. Both require quite good Java and coding skills though.

In the meantime perhaps GeoServer / Geotools should consider reading out the 
info from nodes at init and store it more efficiently. The savings will be huge.
 
_________________________________________
Fredrik Holmqvist, Metria AB
Webb: www.metria.se

------------------------------------------------------------------------------
EditLive Enterprise is the world's most technically advanced content
authoring tool. Experience the power of Track Changes, Inline Image
Editing and ensure content is compliant with Accessibility Checking.
http://p.sf.net/sfu/ephox-dev2dev
_______________________________________________
Geoserver-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geoserver-users

Reply via email to