[Gdal-dev] Forgetting to Destroy?
Curt Mills
hacker at tc.fluke.com
Thu Dec 11 13:37:46 EST 2003
On Thu, 11 Dec 2003, Curt Mills wrote:
> On Thu, 11 Dec 2003, Curt Mills wrote:
>
> > On Thu, 11 Dec 2003, Curt Mills, WE7U wrote:
> >
> > > My code is currently reading Shapefile maps via OGR. If I disable
> > > the feature loop, memory appears relatively stable.
> > >
> > > Enabling the feature loop, I'm losing megabytes every time I read
> > > in Shapefiles.
> >
> > More data: Tried the same thing with SDTS DLG file. First file
> > load takes me from 10588 kbytes to 14508 kbytes, then it stays
> > stable as I pan/zoom (which reads the file in again), actually
> > dropping slightly to around 14476 kbytes.
> >
> > With Shapefiles, the memory just keeps climbing each time I load a
> > file. A lot.
>
> Yet more: Point/Polylines don't appear to trigger it. Happens with
> Polygon and perhaps MultiPolygon files.
Yet another datapoint: My first SDTS test file only contained
Points/Polylines, which did not trigger the memory loss. SDTS files
which contain Polygons _do_ trigger it. Shapefile Multipolygons
also definitely trigger it.
I'm losing memory with these map formats so far:
SDTS Polygons
Shapefile Polygons
Shapefile MultiPolygons
Everything appears ok with only Points/Polylines from the few
formats I've tried.
This is with my "feature" loop essentially disabled: Get each new
feature, and then destroy it.
If I disable even that part of the loop and leave only the layer
loop, memory usage becomes stable. If I use files containing only
Points/Lines, memory usage becomes stable.
--
Curt Mills, WE7U hacker_NO_SPAM_ at tc.fluke.com
Senior Methods Engineer/SysAdmin
"Lotto: A tax on people who are bad at math!"
"Windows: Microsoft's tax on computer illiterates!" -- WE7U
"The world DOES revolve around me: I picked the coordinate system!"
More information about the Gdal-dev
mailing list