I've created a database based on turtle file (of size ~4.5Gb) using rdflib
and started querying it using SPARQL, everything was working smoothly, but after a while I start getting this error:
MemoryError: (12, 'Cannot allocate memory -- BDB2034 unable to allocate memory for mutex; resize mutex region')
The full output:
File "/usr/local/lib/python3.6/site-packages/rdflib/graph.py", line 377, in open
return self.__store.open(configuration, create)
File "/usr/local/lib/python3.6/site-packages/rdflib/plugins/sleepycat.py", line 167, in open
self.__namespace.open("namespace", dbname, dbtype, dbopenflags, dbmode)
MemoryError: (12, 'Cannot allocate memory -- BDB2034 unable to allocate memory for mutex; resize mutex region')
The minimal script:
from rdflib import ConjunctiveGraph, Namespace, Literal
from rdflib.store import NO_STORE, VALID_STORE
db_path = "my_db"
g = ConjunctiveGraph('Sleepycat')
# Open the DB
g.open(db_path, create=False) # <--- this line causes the error
I don't know the cause of the problem, I checked out if I have enough RAM, CPU usage and disk space, everything was OK, I restarted the PC but the error persisted.