mapbox / mapbox/tile-reduce

Memory allocation issue

Open
#109 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

help wanted
Dominant language
JavaScript
Stars
185
Forks
31
PR merge metrics
No merged PRs in 30d

Description

Here's a tile-reduce process that's run for the planet. I'm expecting the script to release memory after processing a tile. Instead process keeps taking up more memory space without freeing up memory for the processed tiles and fails at a point due to memory allocation issue.

Time Spent| Memory
-----------|---------
Before beginning the process|![image](https://user-images.githubusercontent.com/12103383/27681308-6a2510de-5cdc-11e7-8dd9-9a61e97a32d9.png)
10s|![image](https://user-images.githubusercontent.com/12103383/27681355-903ce602-5cdc-11e7-91b8-c2837aac256a.png)
30s|![image](https://user-images.githubusercontent.com/12103383/27681329-7bda34d0-5cdc-11e7-9098-62c7aba284a9.png)
After 1 minute|![image](https://user-images.githubusercontent.com/12103383/27681362-9f1d600c-5cdc-11e7-9cf5-8d2d418c2d81.png)

### Map script

```
'use strict';
module.exports = function(tileLayers, tile, writeData, done) {
done();
};
```

### Reduce script

```
'use strict';

var tileReduce = require('@mapbox/tile-reduce');
tileReduce({
zoom: 12,
map: path.join(__dirname, 'index.js'),
sources: [{
name: 'osm',
mbtiles: 'latest.planet.mbtiles',
}

]
})
```

I'd need help to resolve this issue.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the tile-reduce run using the shown map script, reduce script, and latest.planet.mbtiles source, then inspect memory growth across tiles. Read the @mapbox/tile-reduce entry points involved in map and reduce processing and determine whether memory is retained after done() completes. Done means identifying a reproducible cause and confirming that memory no longer grows until allocation fails.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
data-engineering
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.