Skip to content

Commit

Permalink
Fix #580: Make ByteBufferPool less memory-hungry
Browse files Browse the repository at this point in the history
Reduce the buffer size to 8M based on the fact that the largest .nir file
currently in the repo is java.lang.Character at ~2M:

    > find . -name "*.nir" | xargs stat -f "%z %N" | sort -n | tail -5
    546211 ./scalalib/target/scala-2.11/classes/scala/collection/immutable/StreamViewLike$$anon$13.nir
    580412 ./scalalib/target/scala-2.11/classes/scala/collection/mutable/IndexedSeqLike$$anon$1.nir
    612962 ./javalib/target/scala-2.11/classes/java/math/BigDecimal.nir
    699387 ./javalib/target/scala-2.11/classes/java/util/Arrays$.nir
    2301253 ./javalib/target/scala-2.11/classes/java/lang/Character$.nir
  • Loading branch information
jonas committed Apr 21, 2017
1 parent 74c683d commit 25071d6
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -7,7 +7,7 @@ final class ByteBufferPool {
private var buffers: List[ByteBuffer] = Nil

private def alloc(): ByteBuffer = {
ByteBuffer.allocateDirect(64 * 1024 * 1024)
ByteBuffer.allocateDirect(8 * 1024 * 1024)
}

def reclaim(buffer: ByteBuffer): Unit = synchronized {
Expand Down

0 comments on commit 25071d6

Please sign in to comment.