libkestrel
libkestrel copied to clipboard
Use of MappedByteBuffer can deal to (practically) unbounded virtual memory usage
trafficstars
With a high volume of messages I've seen 20 or more deleted journal files still mapped according to /proc/<pid>/maps.
It looks like the JVM is expected to just unmmap() those when the MappedByteBuffer is GC'd, but I've seen that it can take a surprisingly long amount of time for them to be cleaned up.
Has anyone else experienced this?
It appears this is the solution to unmmap()-ing:
https://github.com/apache/cassandra/blob/f69e043ce4a4c8ecba6682fcd7ddf771a773afea/src/java/org/apache/cassandra/io/util/FileUtils.java#L52-L68 https://github.com/apache/cassandra/blob/f69e043ce4a4c8ecba6682fcd7ddf771a773afea/src/java/org/apache/cassandra/io/util/FileUtils.java#L272-L291