Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [udig-devel] Memory Usage problems (OutOfMemory Exceptions)

Hi,

Both ideas are good.  It is possible that both are needed but I would recommend combining layers first because the second solution does not help with maps with 40 layers it only helps when there are lots of editors open.

One way to do step 1 is to create a new Renderer that is modelled after the WMS Renderer.  The framework already will merge layers together correctly if the Renderer can handle multiple layers.  If you create the Renderer and discard the BasicFeatureRenderer that should help dramatically.

It also should not be too challenging to do this task.  If you do I would love to see it merged back into the main codebase.

I like the other option as well.  In most cases the multiple buffers are only useful when the user changes the layer order or visibility so disposing of the BufferedImages when the editor is hidden is good idea,  but the tricky part is that the code would need to be able to detect that the buffered have been modified and that the layers need to be re-rendered on a visibility change or a layer ordering change.  The code there is kind of tricky so there is more risk involved in doing this. 

Of course if you do do it I would love to review the work (in both cases).

Good luck,

Jesse


On Fri, Oct 1, 2010 at 11:08 AM, Stanislas Nanchen <stanislas.nanchen@xxxxxxxx> wrote:
Hi everyone,

In the project I'm working on, we are using up to 10 open editors with each of them containing around 10-12 layers.
This uses a lot of memory for the renderers buffers and provokes OutOfMemory Exceptions.

We have raised the max heap size on our dev machines, but the customer has more limited machines and so I must
try to lower the memory requirements.

As most of the layers are "static" shape files, one idea is to "merge" shapefiles together so as to reduce the numbers of layers.

Another idea is to tinkle with the udig renderers. Actually, only 2-3 editors are visible at the same time and users switch between
them infrequently. it would be nice to allow single renderers to loose their internal awt.BufferedImage when their editor is hidden
and to force the rendering when their editor become visible again.

But before I try to do such things, I would to ask you for advice of what would be the best approach to limit the memory usage.

Thanks for your help.
Stan.
_______________________________________________
User-friendly Desktop Internet GIS (uDig)
http://udig.refractions.net
http://lists.refractions.net/mailman/listinfo/udig-devel


Back to the top