Open nhthong2001 opened 1 year ago
This error is caused by the very low memory available to the VM. Microstream heavily relies on DirectByteBuffers that use off-heap Memory. In your case the maximum amount of memory allowed for those buffers has been exceeded temporarily.
The available memory for those buffers can be configured with -XX:MaxDirectMemorySize=size
.
The default value may depend on the VM but most likely it is the same as the max Heap Size if specified via -Xmx.
Environment Details
Describe the bug
First I load 1 Lazy<byte[]> onto Ram. Then I unloaded this Lazy<byte[]> out of Ram by Lazy.clear() then I perform GC to free up Ram space. Next I call the function to reload this Lazy<byte[]> then the below error occurs even though my current free Ram space is enough for this load. I call it again and it doesn't throw an error and my function returns the result.
![console2](https://user-images.githubusercontent.com/63918364/215937400-4646242c-f840-4826-b580-91db2942621d.png)
Expected behavior
No error java.lang.OutOfMemoryError: Direct buffer memory
Screenshots