-
Notifications
You must be signed in to change notification settings - Fork 6
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
Is there a way to detect memory leak in Mapnik? #138
Comments
Are you using GDAL? Do you limit GDAL_CACHEMAX? It takes 5% of RAM by default which can easily take 50 GB of memory with 10 workers on a machine with 100 GB RAM. I was profiling memory use of Mapnik several times and it was always GDAL who took the memory. I was using valgrind massif heap profiler. |
Yes, for shading we use gdal. Thank you for the information. I will try it and close the issue if it helps :). |
BTW we use two processes to render map. One is for pre-rendering, running with low priority (nice) and other is for on-demand rendering. Both use 8 mapnik instances. Server has 64 GB RAM. 64 * 0.05 * (8 + 8) = 51.2 so from you describe it can easily get OOM. BTW can't it be configured so that all mapnik instances would share GDAL cache? |
I think the cache is per process, so if you will render in threads, then the cache will be shared. I'm setting it by an environment variable to 256 MB ( |
Env. var |
Problem seems to be caused by mapnik/node-mapnik#950. |
Note that mapnik/node-mapnik#950 (comment) fixed lot of memory leak but there is still some. |
Hello,
We use latest mapnik for node (4.3.1). We observe there some memory leak. During rendering the memory usage rises until kernel kills the process (and it gets restarted by systemd). Our application uses 8 mapnik instances from the pool, destroying instance after it was used 1000 times.
If rendering is at 100% (when we re-render whole map) the process can eat in a cca two hours around 40 GB of RAM.
Rising memory consumption was observed from the beginning since we started to use the library but since last update of styles and maybe also library version (not sure about it) it is even higher.
Can we somehow analyze process dump to find where is it leaking (something that could help mapnik developers)?
We can dump it with https://serverfault.com/a/408929. According to this most memory is taken by heap and most of this heap is occupied by data simmilar to this:
The text was updated successfully, but these errors were encountered: