[JAVA learning] java virtual machine memory configuration, -Xss256m -Xms512m -Xmx800m -XX:MaxPermSize=512m

Reprinted from: https://blog.csdn.net/a503921892/article/details/39048737

Detailed explanation of Xms, Xmx, PermSize, MaxPermSize in configuring the memory size of the tomcat server

Reprinted from: https://blog.csdn.net/starwind_/article/details/52938043

one. Java virtual machine memory configuration:

(1) Operation: project name (eg: CK02) -> right click (select option Properties) -> Run/Debug Settings -> select the program to be executed (eg: Launch) -> click (edit..) -> select ( x) = Arguments is filled in under VM arguments as follows:

-Xmx1024m -Xms512m -XX:MaxPermSize=256m

(2) Parameter analysis:

-Xmx1024m: Set the maximum available memory of the JVM to 1024M.

 

-Xms512m: The virtual machine occupies the minimum memory of the system. This value can be set the same as -Xmx to avoid reallocation of memory by the JVM after each garbage collection is complete.

-XX:MaxPermSize: Maximum heap size. This is also appropriately large, so if there is a problem, please adjust –Xms512m first: set it to a smaller value and it will be ok.

Note: Do not write wrong characters when configuring, otherwise it may cause the myeclipse environment to not be able to run Java programs.

 

two. Eclipse memory configuration:

(1) Configuration method:

 There is an eclipse.ini file under the eclipse file, the configuration is as follows:

-Xmx1024m -Xms512m –XX:PermSize=64m -XX:MaxPermSize=256m

-XX:PermSize: Minimum heap size. Generally, when the memory is insufficient, it is said that this is too small, and the remaining heap space is less than 5%, and a warning will be issued. It is recommended to set this slightly larger, but it should be set according to the memory size of your machine, but it cannot exceed MaxPermSize.

(2) Find the eclipse.ini file:

Click "Start" -> Search: eclipse.ini
3. You can also write the above configuration in the XX.bat file to run the program.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326469686&siteId=291194637