'How to configure limit of response size from Tomcat8 server

I am looking for how to configure or verify limits of response size a Tomcat 8 server can support. I have some GET apis which can return a very large response. I see whenever response is like 50MB or 100MB there is no problem, but sometime it could be much larger than this size. Could be in GBs. Whenever that happens, api is failing. Can someone suggest that at least for Tomcat level, it shouldnt fail. For the other layers e.g. load balancer or web server I will look into it. I know there is request size limit which could be configured by maxHttpHeaderSize. But I am looking for response size.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source