reduce GC by reusing global buffer