troubleshooting Question

java jar file memory alocation

Avatar of JeffBeall
JeffBeallFlag for United States of America asked on
JavaJSPJava App Servers
4 Comments1 Solution792 ViewsLast Modified:
I have a jar file on a ubuntu server, and the recommended settings is

java -Xms512M -Xmx1G -jar /path/to/jarfile

I have tried this, and assigning more memory

java -Xms2048M -Xmx4096M /path/to/jarfile

but it seems to work best to just run the jar with no parameters

java -jar /path/to/jarfile

I'm trying to figure out how this could be? does java just use what it needs, so if i set a 4gb limit for instance, and it would be better to have more that is why it's better not to have parameters? If I don't have any parameters, does java just take what it needs?
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros