dain/leveldb — Issue #9: error when a large amount of
Author: hitman249
Created: 2012-01-12 17:35:42+00:00
State: open

create a database
add 4 billion rows
with "for ()"

when the database size reaches 1 Gb
or number of lines ~ 21692085

java.lang.RuntimeException: Could not open table 2700
at org.iq80.leveldb.impl.TableCache.getTable(TableCache.java:95)
at org.iq80.leveldb.impl.TableCache.newIterator(TableCache.java:77)
at org.iq80.leveldb.impl.DbImpl.finishCompactionOutputFile(DbImpl.java:1112)
at org.iq80.leveldb.impl.DbImpl.doCompactionWork(DbImpl.java:1035)
at org.iq80.leveldb.impl.DbImpl.backgroundCompaction(DbImpl.java:444)
at org.iq80.leveldb.impl.DbImpl.backgroundCall(DbImpl.java:395)
at org.iq80.leveldb.impl.DbImpl.access$100(DbImpl.java:79)
at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:370)
at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:364)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:849)
at org.iq80.leveldb.table.Table.(Table.java:63)
at org.iq80.leveldb.impl.TableCache$TableAndFile.(TableCache.java:118)
at org.iq80.leveldb.impl.TableCache$TableAndFile.(TableCache.java:105)
at org.iq80.leveldb.impl.TableCache$1.load(TableCache.java:65)
at org.iq80.leveldb.impl.TableCache$1.load(TableCache.java:61)
at com.google.common.cache.CustomConcurrentHashMap$ComputingValueReference.compute(CustomConcurrentHashMap.java:3426)
at com.google.common.cache.CustomConcurrentHashMap$Segment.compute(CustomConcurrentHashMap.java:2322)
at com.google.common.cache.CustomConcurrentHashMap$Segment.getOrCompute(CustomConcurrentHashMap.java:2291)
at com.google.common.cache.CustomConcurrentHashMap.getOrCompute(CustomConcurrentHashMap.java:3802)
at com.google.common.cache.ComputingCache.get(ComputingCache.java:46)
at org.iq80.leveldb.impl.TableCache.getTable(TableCache.java:88)
... 13 more
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:846)
... 24 more
java.lang.RuntimeException: Could not open table 2702
at org.iq80.leveldb.impl.TableCache.getTable(TableCache.java:95)
at org.iq80.leveldb.impl.TableCache.newIterator(TableCache.java:77)
at org.iq80.leveldb.impl.TableCache.newIterator(TableCache.java:72)
at org.iq80.leveldb.impl.DbImpl.buildTable(DbImpl.java:936)
at org.iq80.leveldb.impl.DbImpl.writeLevel0Table(DbImpl.java:881)
at org.iq80.leveldb.impl.DbImpl.compactMemTableInternal(DbImpl.java:847)
at org.iq80.leveldb.impl.DbImpl.backgroundCompaction(DbImpl.java:421)
at org.iq80.leveldb.impl.DbImpl.backgroundCall(DbImpl.java:395)
at org.iq80.leveldb.impl.DbImpl.access$100(DbImpl.java:79)
at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:370)
at org.iq80.leveldb.impl.DbImpl$2.call(DbImpl.java:364)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: java.io.IOException: Map failed
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:849)
at org.iq80.leveldb.table.Table.(Table.java:63)
at org.iq80.leveldb.impl.TableCache$TableAndFile.(TableCache.java:118)
at org.iq80.leveldb.impl.TableCache$TableAndFile.(TableCache.java:105)
at org.iq80.leveldb.impl.TableCache$1.load(TableCache.java:65)
at org.iq80.leveldb.impl.TableCache$1.load(TableCache.java:61)
at com.google.common.cache.CustomConcurrentHashMap$ComputingValueReference.compute(CustomConcurrentHashMap.java:3426)
at com.google.common.cache.CustomConcurrentHashMap$Segment.compute(CustomConcurrentHashMap.java:2322)
at com.google.common.cache.CustomConcurrentHashMap$Segment.getOrCompute(CustomConcurrentHashMap.java:2291)
at com.google.common.cache.CustomConcurrentHashMap.getOrCompute(CustomConcurrentHashMap.java:3802)
at com.google.common.cache.ComputingCache.get(ComputingCache.java:46)
at org.iq80.leveldb.impl.TableCache.getTable(TableCache.java:88)
... 15 more
Caused by: java.lang.OutOfMemoryError: Map failed
at sun.nio.ch.FileChannelImpl.map0(Native Method)
at sun.nio.ch.FileChannelImpl.map(FileChannelImpl.java:846)
... 26 more

With a large amount of base, after executing the commands

db.close();
db = factory.open(patch, options);

flying bug

Exception in thread "main" java.io.FileNotFoundException: leveldb\db\000015.sst (The requested operation can not be executed for a file with a user-mapped section open)

Translate by Google*