I am running Eclipse Ganymede version 3.4.2 on a Windows XP box. Not all versions of eclipse require separate lines for. JBoss Tools/RHDS forum post that made me want to write this blog
Sun blog with nice explanation of PermGen and what might cause it in user code Related links Igor's blog about using jconsole to debug memory issues with Eclipse Or help out with reducing the memory footprint of your favorite plugins by running them through a profiler and report found issues or possibly even contribute patches to the Jira :) Use a JVM that uses the normal heap for PermGen-like allocations (that is any non-Sun JVM AFAIK) The trick is to remember each argument has to be on seperate lines: Increase the memory settings via command line or eclipse.ini:Ĭommand line eclipse -vmargs -Xms128m -Xmx512m -XX:MaxPermSize=128m *shameless plug*: Get Red Hat Developer Studio when it is relased which does this automatically for you, or. I normally use -XX:MaxPermSize=128m to make sure I don't run out of PermGen space. The solution for this is to add a MaxPermSize value to the vmargs. This is actually the memory region most people have issues with and not so much the normal heap space, but as a normal user one have a hard time realizing this when eclipse (or rather the jvm) just says "Out of Memory" or simply just crashes. Sun JVM's has a concept of PermGen space that is a *seperate* allocated memory region that is used for e.g. The best way to know if your command line arguments actually has been passed in correctly is to go to Help/About and click "Configuration Details" and check that the property "eclipse.vmargs" contain the values you expected.Īnd that is exactly what happens when you put everything on one line in. The *correct* way of using eclipse.ini is to put each command line argument on individual lines: The above line is simply ignored (or just not parsed correctly) by eclipse and hence the JVM is just started with the Sun VM default memory settings and the user thinks everything is fine. This is all nice, but it is so easy to make it have zero effect by doing what makes the most sense, namely putting all the arguments on a single line in your eclipse.ini: Well, it turns out that the combination of a eclipse.ini's weird syntax and Sun JVM's 'alternative' memory handling can give alot of headache.Įclipse.ini is a configuration file that is located in the root of your Eclipse installation which is used as the default arguments passed to Eclipse. query results when running HQL via Hibernate Tools). This would give some more room for extra many open projects and/or using plugins that might need additional memory (e.g. This is ok for most users, but users can tweak these settings by editing eclipse.ini or via the command line, e.g. Many users seem to have problems with running out of memory when using Eclipse 3.2 in combination with additonal plugins such as those from JBoss Tools or even Eclipse WTP.įor those who just want the solution scroll down to the bottom, you can skip my "rant" about it.Įclipse default memory settings (at least for Eclipse 3.2) is to run with the following memory settings specified in its eclipse.ini file: You have to create one with below parameters.Updated 03.08.07: eclipse.ini is sensitive to which line break is used. Step-1īy default you wont see setenv.sh (for Linux/Mac) or setenv.bat (for windows) file under /bin directory. It’s used to set size for Permanent Generation. It is where class files are kept.Īnother must read: Change -Xmx value of Tomcat in Eclipse IDE Let’s get started:īelow are the simple steps to change -Xmx / -Xms values or other JVM parameters if you are running Tomcat from command prompt. It’s a size of the heap for the young generation. NOTE: there is NO SPACE between -Xmx and 1024m -Xmn The upper limit for this value will be approximately 4000m on Solaris 7 and Solaris 8 SPARC platforms and 2000m on Solaris 2.6 and x86 platforms, minus overhead amounts. So, in simple words, you are saying Java to use Maximum of 1024 MB from available memory. Append the letter k or K to indicate kilobytes, or m or M to indicate megabytes. This value must a multiple of 1024 greater than 2MB. Specifies the maximum size, in bytes, of the memory allocation pool.
In this tutorial we will go over steps on how to configure -Xms, -Xmx and -XX:PermSize value for Tomcat server. It’s very critical for us to configure all correct parameters while running your application in Production environment or even in development env. There are quite a few other alternatives like IBM WebSphere, Geronimo, IIS, etc. Very big companies run on Apache Tomcat now a days. Apache Tomcat is widely used Web Container in the world.