You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello
I started getting this run time error all of a sudden (I upgraded to 0.6.2), but kept java version unchanged.
Not sure at this point if the problem on my side or in lmdbjava.
I am storing images in the database, not text. The error seems to be coming when I am retreiving an image.
java version "1.8.0_152"
Java(TM) SE Runtime Environment (build 1.8.0_152-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.152-b16, mixed mode)
java.lang.NoSuchMethodError: java.nio.ByteBuffer.clear()Ljava/nio/ByteBuffer;
at org.lmdbjava.ByteBufferProxy$UnsafeProxy.out(ByteBufferProxy.java:297)
at org.lmdbjava.ByteBufferProxy$UnsafeProxy.out(ByteBufferProxy.java:260)
at org.lmdbjava.KeyVal.valOut(KeyVal.java:133)
at org.lmdbjava.Dbi.get(Dbi.java:239)
My code invoking Dbi.get is this
public static ByteBuffer getContent_impl_lmdb(final String itemKey,
org.lmdbjava.Env env,
Dbi<ByteBuffer> db ) throws IOException
{
if (env==null) { return null;}
final ByteBuffer key = allocateDirect(env.getMaxKeySize());
key.put(itemKey.getBytes(StandardCharsets.UTF_8))
.flip();
try (Txn<ByteBuffer> txn = env.txnRead()) {
final ByteBuffer found = db.get(txn, key);
if (found!= null) {
// The fetchedVal is read-only and points to LMDB memory
final ByteBuffer fetchedVal = txn.val();
final ByteBufferBackedInputStream bo= new ByteBufferBackedInputStream(fetchedVal);
ByteBuffer holdData= allocate(fetchedVal.remaining());
int bytesRead=bo.read(holdData.array(), 0, fetchedVal.remaining());
return holdData;
}
else {
return null;
}
}
catch (Exception ex) {
logger.error("getContent_impl_lmdb ERROR: "+ex.toString());
throw ex;
}
catch (OutOfMemoryError e) {
final int MEGABYTE = (1024*1024);
MemoryMXBean memoryBean = ManagementFactory.getMemoryMXBean();
MemoryUsage heapUsage = memoryBean.getHeapMemoryUsage();
long maxMemory = heapUsage.getMax() / MEGABYTE;
long usedMemory = heapUsage.getUsed() / MEGABYTE;
logger.error( "getContent_impl_lmdb:: Out of Memory Error : Memory Use :" + usedMemory + "M/" + maxMemory + "M");
throw e;
}
} /*end of getContent_impl_lmdb */
I have not tried to re created consistenly. I am using lmdb for caching.
So I just removed my lmdb database to force my application force random caching again.
and at this point, I have not encountered the run time error again, but I only stressed the system
very slightly.
The text was updated successfully, but these errors were encountered:
Hello
I started getting this run time error all of a sudden (I upgraded to 0.6.2), but kept java version unchanged.
Not sure at this point if the problem on my side or in lmdbjava.
I am storing images in the database, not text. The error seems to be coming when I am retreiving an image.
implementation group: 'org.lmdbjava', name: 'lmdbjava', version: '0.6.2'
My code invoking Dbi.get is this
I have not tried to re created consistenly. I am using lmdb for caching.
So I just removed my lmdb database to force my application force random caching again.
and at this point, I have not encountered the run time error again, but I only stressed the system
very slightly.
The text was updated successfully, but these errors were encountered: