Last active
May 5, 2016 00:27
-
-
Save patter001/f70ba142eb33654fc95d554152a69952 to your computer and use it in GitHub Desktop.
lmdb size test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lmdb | |
def test(): | |
env = lmdb.open("test.lmdb", max_dbs=1, map_size=15*1024*1024) | |
try: | |
value = bytearray(" "*9*1024*1024) | |
with env.begin(write=True, buffers=True) as txn: | |
txn.put("big", value, dupdata=False, overwrite=True) | |
with env.begin(write=True,) as txn: | |
print txn.delete("big") | |
with env.begin(write=True, buffers=True) as txn: | |
txn.put("big", value, dupdata=False, overwrite=True) | |
finally: | |
env.sync() | |
env.close() | |
#import pdb;pdb.set_trace() | |
if __name__ == "__main__": | |
test() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment