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)