This period of time has been using Stylereport to do the report, the report of the Web system deployed to the Tomcat5.5.20, has been the memory overflow, annoying my head is big. Today finally solved, haha. Write it down in case you forget it. My own way: When starting Tomcat with MyEclipse, the following figure (Can not upload the picture here, had to use words to describe) In MyEclipse Select: Window->preferences, select the number on the left of the pop-up window: MyEclipse Enterprise workbench->servers->tomcat->tomcat5.x (i used Tomcat5.5.20)->JDK, At this point, a optional Java VM argumenets text field appears below the right panel, adding:-xmn512m-xmx800m Where:-xmn512m–xmx800m meaning the minimum memory for the Java Virtual machine is 512M and the maximum memory is 800M. here is an article on the Internet (http://blog.csdn.net/fableking/archive/2008/07/22/2691724.aspx) Tomcat itself is a very good server container, free, powerful, behind by a lot of powerful companies and organizations silently support, created a can and WebLogic and other charges containers to contend with the status, but Tomcat itself still has some flaws. At the beginning of the Tomcat design, the Tomcat default JVM allows for a minimum of 64M of memory, and a maximum of 128M, because of the different server performance of the customer, which prevents the virtual memory from being low, but in projects where some projects are consuming a large amount of resources, or high concurrency, It is easy to cause insufficient memory and Tomcat automatically stops without any warning. The best way to do this is to modify the limits that Tomcat uses for JVM memory. There are two methods: 1, edit%catalina_home%/bin below the Catalina.bat file, in front of the top first line written Set java_opts=-xms512m-xmx1024m Where-XMS represents the minimum amount of memory for the JVM,-XMX represents the maximum memory For example, I set the minimum 512, the maximum 1024 Of course, this minimum is not only 1024 of the meaning, in fact, this setting is set on the system, because this JVM memory count is actually for virtual memory, this setting means that no matter how the system occupies virtual memory, to ensure that the minimum 512M of virtual memory for the JVM to use, of course, Even if my JVM takes up a lot, it won't exceed 1024 to threaten the system's memory usage. 2, add the following two values to the environment variable Plus tomcat_opts, catalina_opts two properties, such as SET catalina_opts=-xms512m-xmx1024m; It's the same thing, but how do I look at JVM memory usage? The easiest way is to open Task Manager –> process –> View –> Select columns, selected virtual memory-> OK, you will see the number of virtual memory, at this time, you will see the virtual memory will have 512~1024m space is occupied, then you set a good value to occupy, The memory usage of the JVM, it will be used in this occupied range Another way is to write a small script named ram.jsp Code is <% Runtime lruntime = Runtime.getruntime (); Out.println ("***begin memery STATISTICS ***</br>"); Out.println ("Free Momery:" +lruntime.freememory () + "</BR>"); Out.println ("Max momery:" +lruntime.maxmemory () + "</BR>"); Out.println ("Total momery:" +lruntime.totalmemory () + "</BR>"); OUT.PRINTLN ("Available Processors:" +lruntime.availableprocessors () + "</BR>"); Out.println ("***end memery STATISTICS * * *"); %> What is the meaning of the specific, I believe you run it will understand: |