Open kosarko opened 7 years ago
This isn't precisely a Spring Social issue. From what I understand, it is more related to RestTemplate
from the Spring Framework project. Even if the fix is to call setBufferRequestBody(false)
, that fix would need to be made in Spring Social Google (which is a community-led project, not an officially supported Spring Social project).
I suggest bringing this issue up at https://github.com/spring-social/spring-social-google.
Summary
When you are fetching large data (imagine drive file with size in GBs) there's a possibility for OutOfMemoryError if the data does not fit on the heap.
Actual Behavior
Expected Behavior
When you need to obtain just the InputStream (ie. you are calling
restTemplate.getForObject(url, Resource.class).getInputStream()
) and save the data to a file on disk; the content should not be kept in memory.The call originates from spring-social-google, but that just calls
OAuth2Template.createRestTemplate
, which looks like a reasonable default.Setting
setBufferRequestBody(false)
on theClientHttpRequestFactory
as suggested in https://jira.spring.io/browse/SPR-7909 might solve this issue, but I'm unsure whether there are other consequences to that.Version
1.1.4.RELEASE