Useful startup parameters for Java

Source: Internet
Author: User

#1, set the allocated JVM heap memory size

java-xms128m-xmx2g = "Initial 128M, Max 2G

#2, monitor heap memory overflow errors, and print heap snapshots

Java-xx:+heapdumponoutofmemoryerror-xx:heapdumppath=/tmp/heapdump.hprof = "Turns on heap memory overflow error logging and prints the snapshot to the specified directory

#3, set the allocated permanent memory size

A permanent generation is a separate area in heap memory that contains the object representation of all classes loaded by the JVM;

The permanent generation size set here is not included in the heap memory size set with # #.

java-xx:permsize=128m-xx:maxpermsize=256m = "Initial 128M, Max 256M

#4, set the allocated Cenozoic memory size

The Cenozoic is part of the memory allocated in # #

-xx:newsize and-xx:maxnewsize

Generally set to-XMX/2

Useful startup parameters for Java

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.