By rafaelpmr
Hi all,
I am having trouble increasing the memory of my jvm tomcat 8. my droplet ubuntu 16.04 has 1 gb of memory.
I configured the setenv.sh within the path opt/tomcat/conf file like this:
export CATALINA_OPTS = "$CATALINA_OPTS -Xms256M"
export CATALINA_OPTS = "$CATALINA_OPTS -Xmx512M"
export CATALINA_OPTS = "$CATALINA_OPTS -XX:MaxPermSize=256M"
When starting tomcat the following error is displayed.
Invalid initial heap size: -Xms256M Error: Could not create the Java Virtual Machine. Error: A fatal exception has occurred. Program will exit
I would like some help??
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Doing some digging on this I’ve found a few suggestions on how to either adjust the lines you’ve shared or set these defaults for Java globally.
Following the examples here should help you to resolve this issue.
I followed the guideline at https://www.digitalocean.com/community/tutorials/how-to-install-apache-tomcat-8-on-ubuntu-16-04 It is saying about creating a tomcat service, memory can be set out there:
sudo nano /etc/systemd/system/tomcat.service Environment=‘CATALINA_OPTS=-Xms512M -Xmx1024M -server -XX:+UseParallelGC’
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.