AW: [udig-devel] Heap space error adding/removing graphical layers

Jesse Eichar jeichar at refractions.net
Wed Dec 6 09:13:27 PST 2006


Hi,

There is a limitation to the number of layers that can be  
realistically added because currently each layer has a buffer that it  
writes to that is the size of the screen and is in 32-bit colour.   
Obviously a good chunk of memory especially when the screen is  
large.  So it is better to have large shapefiles than many shapefiles  
because the Shapefile renderer is highly optimized for large  
shapefiles and performance will be much better rendering a 1 GB  
shapefile than 100  100KB shapefiles.

This decision was part of the design because it allows some fun  
optimizations (for example enabling and disabling layers) but as of  
1.1.1 we will have an "intelligent" system that will set a maximum  
number of buffers depending on the memory size so that this issue  
will no longer be a problem.

Jesse

On 6-Dec-06, at 3:54 AM, Schneider, Michael wrote:

> Is grid coverage also involved when the layers are created from  
> shapefiles?
> Using a bunch of shapefile layers instead of the GIF layers I also  
> ran into the same heap space error after adding and removing the  
> layers several times. (Each shapefile only had one single feature,  
> a point in this case.)
>
> Michael
>
> Von: udig-devel-bounces at lists.refractions.net [mailto:udig-devel- 
> bounces at lists.refractions.net] Im Auftrag von Jesse Eichar
> Gesendet: Dienstag, 5. Dezember 2006 18:47
> An: User-friendly Desktop Internet GIS
> Betreff: Re: [udig-devel] Heap space error adding/removing  
> graphical layers
>
> Hi
>
> There are 2 main possibilities that I can think of.
>
> 1.  Make sure that you are passing in a heap space parameter to  
> your application or increase it if you already are.  For example
> -Xmx512M will assign 512 MB of memory to the heap space of the  
> JVM.  That should help with the problem.
> 2.  GridCoverage support is less than perfect at the moment  
> (although Jody is playing with a new version that shows promise)  
> and takes much more memory than it should.  So it is likely that  
> the World+Image is what is causing problems.  I'm not totally sure  
> what can be done about this.  But if it is causing problems then  
> perhaps some memory optimizations can be made.
>
> Jesse
>
>
> On 5-Dec-06, at 3:33 AM, Schneider, Michael wrote:
>
>> Hello,
>>
>> using uDIG RC 5 I got a heap space error after adding several  
>> layers. Each layer was created from a very small graphic (png or  
>> gif file of less than 1 KB) together with a world file. The same  
>> was true when each layer was created from a small shapefile.
>>
>> The intension is as follows: The user creates a list of locations  
>> and these locations are shown on a map. When creating a new list  
>> of locations, the old locations are removed from the map and the  
>> new ones are displayed.
>>
>> I did it similar to the descriptions in the FAQ "How do I create a  
>> map programmatically" and "I want to add an image to the map, how  
>> do I do that?"
>>
>> I created a map using createCreateMapCommand
>> I added about ten layers (see above what the layers looked like)  
>> with either createAddManyLayersCommand (all layers together) or  
>> createAddLayerCommand (one layer at a time)
>> When a new list was created I removed the old layers using  
>> createDeleteLayer command, set the new bounding box with  
>> createSetViewportBBoxCommand and added the new layers to the map.
>> After doing these several times I run into the heap space error.
>> I also get this error when I only add and remove one layer (i.e.  
>> location lists with only one entry), but it takes longer to get  
>> the error.
>>
>> I also tried it "the old way" with MapFactory.processURLs - with a  
>> similar result: The error appeared as well, but it took longer to  
>> get it.
>>
>> Am I doing it the wrong way? Is there a better way?
>>
>> I also wanted to try RC 6a. Are there any changes related to the  
>> layers view and showing the map? In RC 5 after adding the layer to  
>> the map they were displayed at once. In RC 6a I can see them in  
>> the catalog and in the project window, but they do not appear in  
>> the layers view automatically and are not displayed. I'll have a  
>> closer look to that to see whether I get the heap space error in  
>> RC 6a as well.
>>
>> Michael
>>
>> _______________________________________________
>> User-friendly Desktop Internet GIS (uDig)
>> http://udig.refractions.net
>> http://lists.refractions.net/mailman/listinfo/udig-devel
>
> _______________________________________________
> User-friendly Desktop Internet GIS (uDig)
> http://udig.refractions.net
> http://lists.refractions.net/mailman/listinfo/udig-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.refractions.net/pipermail/udig-devel/attachments/20061206/3646a8e8/attachment.html


More information about the udig-devel mailing list