If I use `JsonFeature` and make calls like `httpCl...
# ktor
o
If I use
JsonFeature
and make calls like
httpClient.get<DataClass>("url")
is the underlying httpResponse automatically closed, or does it expect me to close httpClient after each call? I haven't been able to find where the response is closed.
r
You’re creating an
HttpClient
for each call?
o
No, that's the problem. I'm seeing a memory leak in an application -- we share the client between all calls. In the past I've used
get<HttpResponse>(...)
to get the response and close it myself. I'm looking at the transforming
get
call and it doesn't look like it closes the response after reading, so I'm wondering what the safe way to use that method is.
e
Could it be related to this https://github.com/ktorio/ktor/issues/1009 ?
o
I think it could be, yeah.
e
The fix is complete and would be available soon.
r
So in general it should be closed automatically, right?
e
Yes
r
Thanks for confirming!
đź‘Ś 1