Reduce memory consumption by tracking downloads in leveldb