Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How Tomcat increases heap memory

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly shows you "Tomcat how to increase heap memory", the content is easy to understand, clear, hope to help you solve your doubts, the following let the editor lead you to study and learn "Tomcat how to increase heap memory" this article.

Tomcat memory configuration

Tomcat is configured by adding a setenv.sh file to the bin directory under tomcat.

You can then configure the memory allocated to tomcat by writing the following environment variables in the setenv file.

Example:

1. Setenv.sh

Export JAVA_OPTS= "- sever-Xms128m-Xmx512m"

Example 2:

2. Setenv.sh

JAVA_OPTS= "- Djava.awt.headless=true-Dfile.encoding=UTF-8

-server-Xms1536m-Xmx1536m

-XX:NewSize=256m-XX:MaxNewSize=256m-XX:PermSize=256m

-XX:MaxPermSize=256m-XX:+DisableExplicitGC "

In general, just set the-Xmx to 60% of the operating system memory.

-Xms

-Xmx

-XX:PermSize-Set initial PermGen Size.

-XX:MaxPermSize-Set the maximum PermGen Size.

-Xms and-Xmx are used to control Heap Size, which, to put it bluntly, is the memory allocated to applications running in Tomcat. The default-Xms is physical memory 1 to 64, and XMX is 1 to 4.

-XX:PermSize and-- XX:MaxPermsize are the memory exclusively occupied by JVM in Tomcat. The default size is the same as Xms and-Xmx.-XX:PermSize is physical.

The 1x64 prime of the physical memory is 1max 4 of the physical memory.

These are all the contents of the article "how to increase heap memory in Tomcat". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report