I'm writing a tool to call another service, and got a weird problem. When i run the main method file as java application in eclipse, it works fine, but after i build it as a jar and run it from cmd line like java -jar xxx.jar
with exactly the same arguments, i got a 504 gateway timeout(responses are huge but works weirdly fine in eclipse). And actually it runs faster in eclipse, any idea? It works well on both when asking for a small amount of responses.
Asked
Active
Viewed 713 times
0

Cloud_cal
- 132
- 2
- 12
1 Answers
1
Maybe Eclipse is using better JVM settings when it runs the application (i.e. larger heap size).
Try to increase your max heap size (Xmx) when running the JAR:
java -jar yourapp.jar -Xmx1024m
Get inspiration from here: How to set the -Xmx when start running a jar file?

Community
- 1
- 1

Rafael Odon
- 1,211
- 14
- 20