I use a python dictionary to store key value pairs and the dictionary gets too large(>100GB) and hits a memory limit.
What is a better memory efficient data structure to store key value pairs in python? E.g. we can use generators to replace lists
I use a python dictionary to store key value pairs and the dictionary gets too large(>100GB) and hits a memory limit.
What is a better memory efficient data structure to store key value pairs in python? E.g. we can use generators to replace lists
You can use sqlitedict which provides key-value interface to SQLite database. About memory usage. SQLite doesn't need your dataset to fit in RAM. By default it caches up to cache_size pages, which is barely 2MB .
Maybe that could help: https://github.com/dagnelies/pysos
It keeps only the index in memory and keeps the data on disk.