When creating lmdb environment I can specify map size. Is there a way to determine at any point how much of the map size is used up?
In other words, I need to find out how much free space is left to be able to address the issue of running out of space before it happens.
The only thing I could think of is to go through all databases and use mdb_env_stat to get number of branch, leaf and overflow pages. Sum it all up across all dbs (times page size) and compare to the current map size. Is this the correct way to calculate used space?