Opened 20 years ago

Closed 20 years ago

Last modified 20 years ago

#593 closed defect (invalid)

Memory Issues

Reported by: dwall@… Owned by: dmorissette
Priority: high Milestone:
Component: OGR Support Version: 4.1
Severity: normal Keywords:
Cc:

Description

I have some rather large shp files ~ 250MB (it contains river information) and 
when it renders even at small scales the amount of memory consumed seems a 
little excessive - upwards of 100MB before the memory is then released when the 
GGI process is exited.

I have also compiled the code into a dll to implement some further 
functionality so the memory is not freed up completely...

Seems to be happening mainly around the msOGRLayerGetAutoStyle in mapogr.c - 
poStyleManager->GetPart - only a small leak but this is called many times -> a 
blow out.

Couple of possible others - 
if( !(p->proj = pj_init(numargs, args)) ) {  in mapfile.c
GDALAllRegister() in mapgdal.c

Change History (4)

comment:1 by sdlime, 20 years ago

Component: MapServer C LibraryOGR Support
Owner: changed from sdlime to mapserverbugs
Based on the diagnotic work already done I'm reasigning to the owner of OGR
support. Why is OGR support being used instead of native shapefile support?

Steve

comment:2 by dmorissette, 20 years ago

Cc: mapserver-bugs@… added
Owner: changed from mapserverbugs to morissette@…
I'll take this one.  

A few questions for Dave:

Problem #1:
You wrote that you use shapefiles, but found a leak inside
msOGRLayerGetAutoStyle(). This suggests that you use STYLEITEM AUTO which is
supported only by MapInfo and DGN files at the moment.  So are you really using
shapefiles or are you using another format?

Problem #2:
I'll investigate this pj_init call in mapfile.c

Problem #3:
GDALRegister should allocate memory only once and this memory should be freed by
msCleanup() at the end of the CGI execution, if that's not the case then please
provide details.  If you built your own custom program then you may have to call
msCleanup() at some point.

comment:3 by dmorissette, 20 years ago

Resolution: invalid
Status: newclosed
I have run Valgrind on MapServer 4.1 CVS with:
- A mapfile that uses STYLEITEM AUTO with TAB files
- A mapfile that uses shapefiles with a bunch of projections objects

Unfortunately (or fortunately) I get no leaks in the areas that you refer to in
problems #1 and #2.  There are actually no significant leaks at all with the
tests that I made.  This doesn't mean that there are no leaks, but just that we
probably need a very specific mapfile/dataset to produce them.

I'll mark the bug INVALID.  Please reopen if you can provide a testcase to
reproduce. We would also need to know the version of Mapserver that you're using
(please test with the latest 4.1 CVS if you can), and detailed steps to reproduce.

comment:4 by dwall@…, 20 years ago

Apologies - this was a bit half baked...

Yes I was using .MAP files which were causing the issues - will retest and put 
forward a test case.

I have a feeling that something to do with my configuration of the build (as a 
Visual C++ dll) is causing the call to delete the StylePart is not freeing the 
memory properly - anyhoo thanks for the prompt feedback if anyone reads this
Note: See TracTickets for help on using tickets.