[OpenLayers-Users] Performance issues (memory leak?) with WFS

Hugh.Barker at csiro.au Hugh.Barker at csiro.au
Sun Jan 22 18:51:01 EST 2012


Hi all,
I'm building a web application to display data that is updated in real-time (ship's navigation/sensor underway data). I'm using WFS (served up by a Geoserver/PostGIS backend). The core of it looks like this:

underwayWfsProtocol = new OpenLayers.Protocol.WFS.v1_1_0({
    url:  "http://ss-geospatial-hf:8080/geoserver/visage/wfs",
    featureType: currentVoyage,
    featureNS: "visage",
    geometryName: "position"});
        
underwayLayer = new OpenLayers.Layer.Vector("Underway Data", {
    strategies: [new OpenLayers.Strategy.BBOX(), new OpenLayers.Strategy.Cluster({distance: 10}), new OpenLayers.Strategy.Refresh({interval: 300000, force: true})], //Refresh screen every 60 seconds, cluster points //TODO - performance issues
    protocol: underwayWfsProtocol,
    styleMap: new OpenLayers.StyleMap({ //TODO - dynamic styling based on zoom level etc, make latest point different
    pointRadius: 3,
    fillColor: "#ff0000" })});

map = new OpenLayers.Map({
    div: "map",
    layers: [baseLayer = new OpenLayers.Layer.WMS(
        "Bathymetry",
        "http://ss-geospatial-hf:8080/geoserver/visage/wms",
        {layers: "visage:bathytopo2005tif"})],
        center: baseLayerBounds.getCenterLonLat(),
        zoom: 4});
    
map.addLayer(underwayLayer);

I also have some other standard bits and pieces, like a graticule, popups on feature select and so on. Nothing too unusual. 

My problem is with performance - my development platform is Firefox 9.0.1, Win7 64. The map and features load fine initially, however after a number of updates (via the refresh strategy) Firefox's memory usage will balloon, crashing Firefox (and sometimes my whole system) in fairly short order. I've tried with both OpenLayers 2.11 and the latest trunk version.

Any advice would be great - I'm at a bit of a loss. If at all possible I'd like to stick with the WFS approach, as the functionality is a good fit for my application vs WMS - just not the performance.

Cheers,

Hugh Barker


More information about the Users mailing list