GeoServer

org.vfny.geoserver.config.CoverageConfig causes memory overflow

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.6.3
  • Fix Version/s: 1.6.4, 1.7.0-beta1
  • Component/s: Configuration
  • Labels:
    None
  • Environment:
    all platforms
  • Number of attachments :
    0

Description

I am developing and image mosaicing/pyradmid plugin for geotools and did some tests with geoserver.

The size of the pyramids are beyond some Gigs and the constructor of CoverageConfig does a test read using 1/20 of the width and hight of the full extent. That is to much and causes a memory overflow.

Activity

Hide
Andrea Aime added a comment -

Simone, Alessio, I'm wondering if the code could be refactored so that a fixed size area of the coverage can be extracted, say no more than 20x20 pixels (make that the minimum between 1/20th of the area and a grid that's 20 pixel wide). Looking at the code it seems that the grid geometry could be extracted without needing to actually read a grid coverage (the reader can provide both the grid to world transformation and the envelope), what's missing from the reader interface are the grid coverage sample dimensions. Given the envelope and the grid to world transformation is should be possible to estimate the area equivalent to a a 20x20 pixel area no?

Show
Andrea Aime added a comment - Simone, Alessio, I'm wondering if the code could be refactored so that a fixed size area of the coverage can be extracted, say no more than 20x20 pixels (make that the minimum between 1/20th of the area and a grid that's 20 pixel wide). Looking at the code it seems that the grid geometry could be extracted without needing to actually read a grid coverage (the reader can provide both the grid to world transformation and the envelope), what's missing from the reader interface are the grid coverage sample dimensions. Given the envelope and the grid to world transformation is should be possible to estimate the area equivalent to a a 20x20 pixel area no?
Hide
Andrea Aime added a comment -

Btw, Christian, if you have developed a grid coverage plugin you should also be able to cook a patch for this one. That would be much appreciated.

Show
Andrea Aime added a comment - Btw, Christian, if you have developed a grid coverage plugin you should also be able to cook a patch for this one. That would be much appreciated.
Hide
Christian Mueller added a comment -

I tried the following at line 261 in CoverageConfig

parameters.put(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(),
new GridGeometry2D(reader.getOriginalGridRange(), subEnvelope));

replaced by

parameters.put(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(),
new GridGeometry2D(new GeneralGridRange(new Rectangle(0, 0,20, 20)),subEnvelope));

This works for my plugin, I am not sure how this will behave for other plugins, but I think it is ok to request a fixed pixel size.

Show
Christian Mueller added a comment - I tried the following at line 261 in CoverageConfig parameters.put(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(), new GridGeometry2D(reader.getOriginalGridRange(), subEnvelope)); replaced by parameters.put(AbstractGridFormat.READ_GRIDGEOMETRY2D.getName().toString(), new GridGeometry2D(new GeneralGridRange(new Rectangle(0, 0,20, 20)),subEnvelope)); This works for my plugin, I am not sure how this will behave for other plugins, but I think it is ok to request a fixed pixel size.
Hide
Simone Giannecchini added a comment -

Ciao Christian,
I am about to put in a similar fix.
Would you be so kind to test it out?

Show
Simone Giannecchini added a comment - Ciao Christian, I am about to put in a similar fix. Would you be so kind to test it out?
Hide
Christian Mueller added a comment -

Ok, but where do I get the source for testing ?

Show
Christian Mueller added a comment - Ok, but where do I get the source for testing ?
Hide
Simone Giannecchini added a comment -

Tentative fix commited on trunk

Show
Simone Giannecchini added a comment - Tentative fix commited on trunk
Hide
Christian Mueller added a comment -

Since I am working on the 1.6.3 version your fix in the trunk does not compile.

e.g there is no Class GridRange2D and no package org.geoserver.data.util. I need this fix in the stable branch since I have to do production deployment.

Show
Christian Mueller added a comment - Since I am working on the 1.6.3 version your fix in the trunk does not compile. e.g there is no Class GridRange2D and no package org.geoserver.data.util. I need this fix in the stable branch since I have to do production deployment.
Hide
Christian Mueller added a comment -

Since I am working on the 1.6.3 version your fix in the trunk does not compile.

e.g there is no Class GridRange2D and no package org.geoserver.data.util. I need this fix in the stable branch since I have to do production deployment.

Show
Christian Mueller added a comment - Since I am working on the 1.6.3 version your fix in the trunk does not compile. e.g there is no Class GridRange2D and no package org.geoserver.data.util. I need this fix in the stable branch since I have to do production deployment.
Hide
Simone Giannecchini added a comment -

Committed a fix on 1.6.x, please try and report

Show
Simone Giannecchini added a comment - Committed a fix on 1.6.x, please try and report
Hide
Christian Mueller added a comment -

Perfect, tests have been successfully

Show
Christian Mueller added a comment - Perfect, tests have been successfully
Hide
Andrea Aime added a comment -

All these issues have been in "resolved" state for at least one month (many of them, much more than that). Since no one has reopened them, I'm mass-switching them to closed state. Reopen if you feel the issue has not been addressed properly.

Show
Andrea Aime added a comment - All these issues have been in "resolved" state for at least one month (many of them, much more than that). Since no one has reopened them, I'm mass-switching them to closed state. Reopen if you feel the issue has not been addressed properly.

People

Vote (0)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: