• Post Reply Bookmark Topic Watch Topic
  • New Topic

forgot to call close connection  RSS feed

Ranch Hand
Posts: 43
Chrome Java Notepad
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I used okhttp library to call API Calls on a website of mine based on WordPress. In that call, I forgot to close connection in the end and called various endpoints on the loop. Next morning I saw that the CPU and RAM usage was still high even after 6 hours of performing calls, which led me to infer that the possibility is that I forgot to close the connections and when I checked I saw I forgot to call response.body().close()

Now here is am thinking,  doesn't the server close the connection automatically and release resources after a certain time if I don't  close connection manually?
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!