public static void setPolicy(ByteBufAllocPolicy policy) {
        LOGGER.info("Set alloc policy to {}", policy);
        ByteBufAlloc.policy = policy;
        ByteBufAlloc.allocator = getAllocatorByPolicy(policy);
        ByteBufAlloc.metric = getMetricByAllocator(allocator);
    }
Set the policy used to allocate memory.
s3stream/src/main/java/com/automq/stream/s3/ByteBufAlloc.java