Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak -- doesn't close raster files #4389

Closed
leftys opened this issue Jul 13, 2012 · 7 comments
Closed

Memory leak -- doesn't close raster files #4389

leftys opened this issue Jul 13, 2012 · 7 comments

Comments

@leftys
Copy link

leftys commented Jul 13, 2012

When used in FCGI configuration, I observe raising memory usage of mapserv processess. lsof shows that mapserver still has opened all the tiff files served since it's start. Memory usage goes as high as 100MB and depends on the total number of layers served.

Mapserv 5.6.5, Gdal 1.6.3

@leftys
Copy link
Author

leftys commented Jul 13, 2012

Happens on 6.0.1 as well.

@ghost ghost assigned warmerdam Jul 13, 2012
@sdlime
Copy link
Member

sdlime commented Jul 13, 2012

Hoping Frank is available to comment... Steve CC'ing: @warmerdam

@aboudreault
Copy link
Member

Try to use that config if you want gdal to always close its raster files:

LAYER
...
PROCESSING "CLOSE_CONNECTION=ALWAYS"
...
END

On 12-07-13 10:53 AM, leftys wrote:

When used in FCGI configuration, I observe raising memory usage of mapserv processess. lsof shows that mapserver still has opened all the tiff files served since it's start. Memory usage goes as high as 100MB and depends on the total number of layers served.

Mapserv 5.6.5, Gdal 1.6.3


Reply to this email directly or view it on GitHub:
#4389

@dmorissette
Copy link
Contributor

I believe rasters have CLOSE_CONNECTION=DEFER by default. Perhaps try CLOSE_CONNECTION=ALWAYS if you are working with large numbers of raster images and cannot afford the overhead of keeping them open (performance vs memory usage tradeoff)

@dmorissette
Copy link
Contributor

Ah, I see aboudreault already commented the same thing :)

@sdlime
Copy link
Member

sdlime commented Aug 7, 2012

Can this be closed as invalid, anyone? Steve

@tbonfort
Copy link
Member

tbonfort commented Aug 7, 2012

Yes, I believe this is working as expected. A future enhancement might be to use a global connection pool with a fixed capacity and a LRU strategy for closing unused connections.

@tbonfort tbonfort closed this as completed Aug 7, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants