eclipse.ini is a text file whose content is equivalent to the command line arguments added to eclipse.exe when eclipse is running
eclipse.ini configuration details
The eclipse startup is controlled by % ECLIPS E_HOME %/eclipse.ini. If $ECLIPSE_HOME is not defined, the default eclipse.ini in the eclipse installation directory will take effect. eclipse.ini is a text file whose content is equivalent to the command line arguments added to eclipse.exe when eclipse is running.
Format:
1: All options and their related parameters must be in a separate line. If the parameter is in the form of "item value", the space in the middle needs to be written on a new line. If there is a space in the value, it needs to be enclosed in double quotation marks;
2: All parameters after -vmargs will be transmitted to the JVM, all if all parameters set to Eclipse must be written before -vmargs.
Some parameters are as follows:
-arch [processor architecture]
Description: Specifies the class of processor used
Example: -arch x86 or -arch sparc
-application [id]
Description: Specify the application to run, the id is the plugin id that extends the org.eclipse.core.applications extension point plus the extension id
For example: For example, if there is a plugin whose id is edu.sdu.app and the extension id is myapp, then -application edu.sdu.app.myapp will execute your extension application
-clean
Description: Empty plugin cache content
For example: -clean, sometimes the plug-in cannot be displayed because Eclipse caches the plug-in to speed up the startup process. If this parameter is specified, the cache will be cleared and loaded from scratch
-configuration [cofigfile location]
Description: Specify the location of the configuration file, use the configuration file config.ini in this directory to start at startup
Example: -configuration d:/eclipse/configuration
-data [workspace location]
Description: Specifies the Workspace location at startup
Example: For example, if the Workspace location is set to D:/myworkspace, then -data D:/myworkspace
-debug [option file]
Description: Start Eclipse in Debug state, all Debug switches are specified in the .options file
Example: -debug d:/eclipse/.options
-dev [classpath entry]
Description: Starts Eclipse in development state, which adds all specified paths as the Classpath for each plugin
Example: For example -dev bin will load all classes generated in the bin directory into the classpath, which is very useful when developing plugins
-nosplash
Description: Specifies that the splash screen should not be displayed at startup
Example: -nosplash
-vm [jre path]
Description: Specifies the Java virtual machine to use at startup
For example: For example, if you want to use your own Java virtual machine, then -vm D:/j2sdk1.4.2_04/jre/bin/java.exe, which has the advantage of opening a Console to display console information. Of course, if Using -vm D:/j2sdk1.4.2_04/jre/bin/javaw.exe will no longer display the console
Note that the format of the -vm option has strict requirements:
1: The -vm option and its value (path) must be on a separate line;
2: Its value must point strictly to the Java executable, not just the Java home directory;
3: The -vm option must be before the -vmargs option. It has been said before that all options after -vmargs will be passed directly to the JVM.
-vmargs [Java VM arguments]
Description: Specifies the Java virtual machine parameters to use at startup
Note: This parameter must be placed at the end of all parameter variables
like -vmargs
-Xms40m
-Xmx256m
-XX:PermSize=64M
-XX:MaxPermSize=128M
Heap and Non-heap memory
According to the official statement: "The Java virtual machine has a heap. The heap is the runtime data area from which memory for all class instances and arrays is allocated. The heap is created when the Java virtual machine starts." The external memory is called non-heap memory (Non-heap memory). It can be seen that the JVM mainly manages two types of memory: heap and non-heap. In short, the heap is the memory accessible to Java code, which is reserved for developers; non-heap is reserved for the JVM, so the memory required for method area, JVM internal processing or optimization (such as JIT compiled code) caches), each class structure (such as runtime constant pool, field and method data), and the code for methods and constructors are in off-heap memory.
Heap memory allocation:
The memory initially allocated by the JVM is specified by -Xms, and the default is 1/64 of the physical memory;
The maximum memory allocated by the JVM is specified by -Xmx, and the default is 1/4 of the physical memory.
When the default free heap memory is less than 40%, the JVM will increase the heap until the maximum limit of -Xmx;
When the free heap memory is greater than 70%, the JVM will reduce the heap up to the minimum limit of -Xms.
Therefore, the server generally sets -Xms, -Xmx equal to avoid adjusting the size of the heap after each GC.
Off-heap memory allocation:
JVM uses -XX:PermSize to set the initial value of non-heap memory, the default is 1/64 of physical memory;
The maximum non-heap memory size is set by XX:MaxPermSize, the default is 1/4 of the physical memory.
JVM memory limit (max)
First of all, the JVM memory is limited to the actual maximum physical memory. Assuming that the physical memory is infinite, the maximum value of the JVM memory has a great relationship with the operating system. To put it simply, although the controllable memory space of a 32-bit processor has 4GB, the specific operating system will impose a limit, which is generally 2GB-3GB (generally 1.5G-2G under Windows system and 1.5G-2G under Linux system). 2G-3G), and processors above 64bit will have no restrictions.
There are several reasons why the program cannot be started due to setting VM parameters:
1) The value of -Xms in the parameter is greater than -Xmx, or the value of -XX:PermSize is greater than -XX:MaxPermSize;
2) The sum of the value of -Xmx and -XX:MaxPermSize exceeds the maximum limit of JVM memory, such as the current operating system maximum memory limit, or actual physical memory, etc.
When it comes to actual physical memory, it should be noted that if your memory is 1024MB, it is not possible to use 1024MB in the actual system, because part of it is occupied by hardware.
Detailed explanation of local eclipse.ini;
-startup
plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.1.R36x_v20100810
-product
org.eclipse.epp.package.jee.product
--launcher.defaultAction
openFile
--launcher.XXMaxPermSize (note that there are two connecting lines in front, which are basically the same as XX:MaxPermSize, the only difference is the front
256M is the parameter set when eclipse.exe starts, the latter is the parameter in the JVM used by eclipse, you can use # to comment out one. )
-showsplash
org.eclipse.platform
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms40m
-Xmx512m
-Dfile.encoding=UTF-8 (The default encoding method of eclipse is the encoding method of the operating system kernel, which is naturally in Chinese Windows
-Dsun.jnu.encoding=UTF-8 GBK, but the general text file is in UTF-8 format, which causes conflicts, so it is necessary to redefine the encoding method of the JVM. )