This repository has been archived by the owner on May 17, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Memory holding issue #14
Comments
pmap shows me huge blocks of [anon] memory, e.g.
Could it be side effects of frequent opening/closing MMapBuffer? |
Seems it was a bug in big library, it uses non-static ThreadLocal field for tmp buffers. So please ignore this issue. If big library fix won't help I'll reopen this issue. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Recently I switched from ByteBuffer to this library so as able to work with files > 2GB in library for reading *.bw files (0.3.6 -> 0.4.x changes in https://github.com/JetBrains-Research/big) . Unfortunately I've faced with memory issues, looks like MMapBuffer.close() doesn't actually mark memory as free. Finally my process is killed by linux OOM killer
I'm pretty sure than I don't have other memory leaks in my application. It works with ByteBuffer based big library version. My application sequentially performs some calculations. Each iteration (calculation) opens
MMapBuffer(Path path, FileChannel.MapMode mapMode, ByteOrder order)
~30 files (~200 mb) in parallel (each file in own thread), than does multiple reads of different parts of each file and then closes related MMapBuffer. Using your library memory consumption is continuously increasing according totop
. Alsolsof
shows me that during each operation I have 30 memory mapped files, in the end of each iteration I get expected 0 mem mapped files. I added some logging, so I'm sure that each opened MMapBuffer will be closed in the end of each iteration. I cannot figure out what is going on and why memory consumption grows. My code finishes on machine with 378 GB RAM and killed by OOM killer on machine with 190 GB RAM. As I mentioned before ByteBuffer based impl successfully works on machine with 190 GB RAM and consume significantly less memory although memory mapped files are unmapped by JVM in some random moments and normally stays mapped after all iterations have completed.Do you have any recommendations how to fix or identify this memory leak? Big library doesn't use madvise features or tracked buffers. I really wan't to use your library to deal with large files, but current issue stops me from such switch.
The text was updated successfully, but these errors were encountered: