This will improve performance and it will also reduce the memory usage so java has plenty of memory to prevent it causing the server to stall when it runs gc.
See https://help.dreamhost.com/hc/en-us/articles/215945987-Web-server-performance-comparison and https://theorganicagency.com/blog/apache-vs-nginx-performance-comparison/