The change makes sense because it reclaims memory that could otherwise sit unused, but it will cause massive allocations if most of the object graphs you serialize are >= 128k. In this case, a new buffer is allocated for every serialization.
In my application, most object graphs are 64k-512k leading to very frequent reallocation of the built-in buffer.
Currently, my only option is to manage a pool of MemoryBuffers myself and pass them to Fury instead of relying on the built-in buffer, but this makes using Fury significantly more complex.
Would it make sense to make the buffer size limit configurable? In my case, a 1MB limit would be ideal.
Question
Since https://github.com/apache/fury/commit/01f1b66383a127a801f22ebe7fac5ca54d675878 Fury's internal
MemoryBuffer
is reset to 128k after every use.The change makes sense because it reclaims memory that could otherwise sit unused, but it will cause massive allocations if most of the object graphs you serialize are >= 128k. In this case, a new buffer is allocated for every serialization.
In my application, most object graphs are 64k-512k leading to very frequent reallocation of the built-in buffer.
Currently, my only option is to manage a pool of
MemoryBuffers
myself and pass them to Fury instead of relying on the built-in buffer, but this makes using Fury significantly more complex.Would it make sense to make the buffer size limit configurable? In my case, a 1MB limit would be ideal.