By default the RestClient uses a HeapBufferedResponseConsumerFactory with a buffer size of 100MB. If we used a non-blocking JSON parser, we could avoid the buffer altogether by parsing the response to a JsonObject on the fly.
Jackson seems to provide non-blocking parsing as of version 2.9: https://github.com/FasterXML/jackson-core/issues/57
Another non-blocking parser is Actson: https://github.com/michel-kraemer/actson
Also to be taken into account: the performance of the parser. See