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 #42

Closed
mourner opened this issue Oct 28, 2015 · 5 comments
Closed

Memory leak #42

mourner opened this issue Oct 28, 2015 · 5 comments
Assignees
Labels

Comments

@mourner
Copy link
Member

mourner commented Oct 28, 2015

When you're not accumulating results on reduce events, the memory consumption still creeps up so you can easily go out of memory on a large number of tiles. This doesn't look right — there's probably a big memory leak somewhere.

@mourner mourner added the bug label Oct 28, 2015
@mourner mourner self-assigned this Oct 28, 2015
@mourner
Copy link
Member Author

mourner commented Oct 28, 2015

Found the cause. Asynchronous zlib.unzip leaks memory when you call it many thousands of times at once. Switching to unzipSync here fixes the leak (only supported by node 0.12+).

In theory, maxrate could help with this, but it is not set by default for mbtiles sources. But even if you set it, maxrate is broken anyway #44.

To fix it the proper way, we need to ditch maxrate completely and instead switch to a global queue with a max limit, so that only a certain number of tiles is processed at the same time, and a new tile doesn't start to be even loaded or parsed from MBTiles before we completed a previous tile.

@mourner
Copy link
Member Author

mourner commented Oct 28, 2015

cc @MateoV @morganherlocker @tcql

@morganherlocker
Copy link
Contributor

nice catch!

@mourner
Copy link
Member Author

mourner commented Oct 30, 2015

I was wrong, unzipSync does not fix the memory issue entirely — memory still creeps up on long-running tasks. However the next-gen tile-reduce should solve all memory problems.

@mourner
Copy link
Member Author

mourner commented Oct 30, 2015

Will be fixed by #46.

@mourner mourner closed this as completed Nov 12, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants