title: 504 Gateway Time-out issue in Spring Boot when uploading large file in tomcat server
body: <p>I am trying to upload a large CSV file (500MB) file in tomcat server . But everytime I am getting "<strong>504 Gateway Time-out</strong>" error. </p>
  
  <p>I am not getting any issue in catalina.out file </p>
  
  <pre><code>**Part of my application.properties file**
  
  async-timeout-ms: 1800000 #AsyncTimeout on the connector.
  keepAliveTimeout: 1800000 # KeepAliveTimeout on the nioHandler.
  connection-timeout-ms: 1800000 # Connection Timeout on the nioHandler
  
  innodb_strict_mode = 0
  GLOBAL max_connections = 1500; 
  # ==============================================================
  
  spring.servlet.multipart.maxFileSize=800MB
  spring.servlet.multipart.maxRequestSize=800MB
  spring.http.multipart.max-file-size=800MB
  spring.http.multipart.max-request-size=800MB
  </code></pre>
  
  <p>The following error occurs in the stacktrace:</p>
  
  <pre><code>...
  java.lang.OutOfMemoryError: Java heap space
  ...
  Caused by: org.springframework.jmx.export.UnableToRegisterMBeanException: Unable to register MBean [HikariDataSource (HikariPool-4)] with key 'dataSource'; nested exception is javax.management.InstanceAlreadyExistsException: dataSource_flashsale:name=dataSource,type=HikariDataSource 
  </code></pre>