chaokunyang commented on code in PR #2457:
URL: https://github.com/apache/fory/pull/2457#discussion_r2267122103
##########
java/fory-core/src/main/java/org/apache/fory/memory/MemoryBuffer.java:
##########
@@ -1249,6 +1247,13 @@ private void growBuffer(int length) {
length < BUFFER_GROW_STEP_THRESHOLD
? length << 2
: (int) Math.min(length * 1.5d, Integer.MAX_VALUE - 8);
+ if (heapMemory == null) {
+ ByteBuffer bb = ByteBuffer.allocateDirect(newSize);
Review Comment:
This is very slow. We can not use this api to allocate direct buffer. How
about set a global direct buffer allocator instead and use that to allocate
buffer. It's also what https://github.com/apache/fory/issues/2350 want to have
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]