Today, I am going to use eclipse to write a Python script. I just started eclipse. A MessageBox pops up and the error "cocould not create the Java Virtual Machine" is reported, I used it to write a program some time ago. How can I suddenly get this error? Open the task manager and check that the memory has been consumed almost because of several vs2005 instances. Originally, the memory was MB, now there is only more than 700 mb left. Is the memory insufficient? Why does the creation of the Java Virtual Machine fail?
Open the eclipse. ini file in the eclipse installation folder. The content is as follows:
-Vmargs
-Xms512m
-Xmx1024m
-XX: permsize = 64 m
-XX: maxpermsize = 128 m
I do not know what it means for the moment, but I know that it controls eclipse memory consumption. The modification is as follows:
-Vmargs
-Xms128m
-Xmx512m
-XX: permsize = 64 m
-XX: maxpermsize = 128 m
You can start eclipse again. What are the meanings of these parameters? Google:
-Vmargs indicates the following parameters for setting JVM (Java Virtual Machine). That is to say, the following are the parameters of Java Virtual Machine. For JVM, the memory is divided into heap memory and non-heap memory, note that the heap here is not the heap concept in C/C ++, because the JVM manages the memory itself. The so-called heap memory is the memory that the JVM can allocate to Java applications, it is limited by the-XMS and-xmx parameters, and the non-heap memory is used by the JVM itself, which are limited by the-XX: permsize and-XX: maxpermsize parameters. For heap memory, the JVM adjusts the size of the entire heap memory based on the remaining heap memory. The adjustment range is the range specified by-XMS (minimum) and-xmx (maximum, -XX: permsize and-XX: maxpermsize are the same. If you do not want the JVM to dynamically adjust them, you can set the maximum and minimum values to be equal. The default minimum value is 1/64 of the physical memory, the maximum value is 1/4 of the physical memory, so the maximum value is limited by the physical memory (of course, the operating system is also limited ).
After experiments, we found that if the value of-XMS is greater than the value set by-xmx, the startup will fail. If the value set by-xmx and-XX: maxpermsize is greater than the available physical memory, the startup will also fail. In my first setting, the sum of the two will exceed 1 GB, and the available memory will only be 700 mb at that time, so the startup will fail, JVM detects parameters and actual available memory at startup.
[End]