I'm using IDEA 12 Leda on Mountain Lion. I wanted to increase the maximum memory that IDE can use. I set the VMOptions in Info.plist file to be
-Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar
When I open up IDEA, I still see the maximum memory to be 711m.
jps -v shows my VMOptions has been loaded but it's replaced by the following options.
29388 **-Xmx2048m** -ea -XX:+HeapDumpOnOutOfMemoryError -Xverify:none -Xbootclasspath/a:../lib/boot.jar -Xms128m **-Xmx800m** -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=64m -XX:+UseCodeCacheFlushing -XX:+UseCompressedOops -Didea.paths.selector=IdeaIC12 -Dsun.java2d.noddraw=true -Didea.max.intellisense.filesize=2500 -Didea.dynamic.classpath=false -Didea.jars.nocopy=false -Dsun.java2d.d3d=false -Dapple.awt.fullscreencapturealldisplays=false -Dapple.laf.useScreenMenuBar=true -Djava.endorsed.dirs= -Dswing.bufferPerWindow=false -Didea.fatal.error.notification=enabled -Didea.cycle.buffer.size=1024 -Didea.popup.weight=heavy -Didea.xdebug.key=-Xdebug -Dapple.awt.graphics.UseQuartz=true -Dsun.java2d.pmoffscreen=false -Didea.no.launcher=false -DCVS_PASSFILE=~/.cvspass -Didea.use.default.antialiasing.in.editor=false -Dcom.apple.mrj.application.live-resize=false -Didea.smooth.progress=false
29392 Jps -Dapplication.home=/System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home -Xms8m
Where does -Xmx800 come from? I need to remove it.
Current version: Help | Change Memory Settings:
Since IntelliJ IDEA 15.0.4 you can also use: Help | Edit Custom VM Options...:
This will automatically create a copy of the .vmoptions file in the config folder and open a dialog to edit it.
Older versions:
IntelliJ IDEA 12 is a signed application, therefore changing options in Info.plist is no longer recommended, as the signature will not match and you will get issues depending on your system security settings (app will either not run, or firewall will complain on every start, or the app will not be able to use the system keystore to save passwords).
As a result of addressing IDEA-94050 a new way to supply JVM options was introduced in IDEA 12:
Now it can take VM options from
~/Library/Preferences/<appFolder>/idea.vmoptions and system properties
from ~/Library/Preferences/<appFolder>/idea.properties.
For example, to use -Xmx2048m option you should copy the original .vmoptions file from /Applications/IntelliJ IDEA.app/bin/idea.vmoptions to ~/Library/Preferences/IntelliJIdea12/idea.vmoptions, then modify the -Xmx setting.
The final file should look like:
-Xms128m
-Xmx2048m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-XX:+UseCompressedOops
Copying the original file is important, as options are not added, they are replaced.
This way your custom options will be preserved between updates and application files will remain unmodified making signature checker happy.
Community Edition: ~/Library/Preferences/IdeaIC12/idea.vmoptions file is used instead.
[Updated Aug 2021 since the JetBrains UI has changed]
Helpful trick I thought I'd share on this old thread.
You can see how much memory is being used and adjust things accordingly using the Memory Indicator
Right click in the bottom most taskbar area and select the Memory Indicator item
It shows up in the lower right of the window.
For IDEA 13 and OS X 10.9 Mavericks, the correct paths are:
Original: /Applications/IntelliJ IDEA 13.app/Contents/bin/idea.vmoptions
Copy to: ~/Library/Preferences/IntelliJIdea13/idea.vmoptions
Here is a link to the latest documentation as of today http://www.jetbrains.com/idea/webhelp/increasing-memory-heap.html
go to that path "C:\Program Files (x86)\JetBrains\IntelliJ IDEA 12.1.4\bin\idea.exe.vmoptions"
and change size to -Xmx512m
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=64m
-XX:+UseCodeCacheFlushing
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
hope its will work
As for the intellij2018 version I am using the following configuration for better performance
-server
-Xms1024m
-Xmx4096m
-XX:MaxPermSize=1024m
-XX:ReservedCodeCacheSize=512m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:+AggressiveOpts
-XX:+CMSClassUnloadingEnabled
-XX:+CMSIncrementalMode
-XX:+CMSIncrementalPacing
-XX:CMSIncrementalDutyCycleMin=0
-XX:-TraceClassUnloading
-XX:+TieredCompilation
-XX:SoftRefLRUPolicyMSPerMB=100
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Xverify:none
-XX:ErrorFile=$USER_HOME/java_error_in_idea_%p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_idea.hprof
More recent versions of IntelliJ (certainly WebStorm and PhpStorm) have made this change even easier by adding a Help >> Change Memory Settings menu item that opens a dialog where the memory limit can be set.
OSX 10.9, if you dont bother about signed application you might just change
/Applications/IntelliJ\ IDEA\ 12\ CE.app/bin/idea.vmoptions
On my machine this only works in bin/idea.vmoptions, adding the setting in ~/Library/Preferences/IntelliJIdea12/idea.vmoptions causes the IDEA to hang during startup.
It looks like IDEA solves this for you (like everything else). When loading a large project and letting it thrash, it will open a dialog to up the memory settings. Entering 2048 for Xmx and clicking "Shutdown", then restarting IDEA makes IDEA start up with more memory. This seems to work well for Mac OS, though it never seems to persist for me on Windows (not sure about IDEA 12).
Some addition to the top answer here https://stackoverflow.com/posts/13581526/revisions
Change memory as you wish in .vmoptions
Enable memory view as told here https://stackoverflow.com/a/39563251/5515861
And you'll have something like this in the bottom right
I use Mac and Idea 14.1.7. Found idea.vmoptions file here: /Applications/IntelliJ IDEA 14.app/Contents/bin
details
I edited the config file from the editor and on the next reboot IntelliJ would not open even after updating to the newest version. After opening IntelliJ manually using /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea in terminal the output gave me additional insight on where the .vmoptions copy is stored.
➜ ~ /Applications/IntelliJ\ IDEA.app/Contents/MacOS/idea
2022-04-21 13:01:55.189 idea[1288:14841] allVms required 1.8*,1.8+
2022-04-21 13:01:55.192 idea[1288:14845] Current Directory: /Users/richardmiles
2022-04-21 13:01:55.192 idea[1288:14845] parseVMOptions: IDEA_VM_OPTIONS = (null)
2022-04-21 13:01:55.192 idea[1288:14845] fullFileName is: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2022-04-21 13:01:55.192 idea[1288:14845] fullFileName exists: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2022-04-21 13:01:55.192 idea[1288:14845] parseVMOptions: /Applications/IntelliJ IDEA.app/Contents/bin/idea.vmoptions
2022-04-21 13:01:55.192 idea[1288:14845] parseVMOptions: /Applications/IntelliJ IDEA.app.vmoptions
2022-04-21 13:01:55.195 idea[1288:14845] parseVMOptions: /Users/richardmiles/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions
2022-04-21 13:01:55.195 idea[1288:14845] parseVMOptions: platform=17 user=1 file=/Users/richardmiles/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions
Invalid maximum heap size: -Xmx2048m -Drun.processes.with.pty=true
Invalid maximum heap size: -Xmx2048m -Drun.processes.with.pty=true
2022-04-21 13:01:55.266 idea[1288:14845] JNI_CreateJavaVM (/Applications/IntelliJ IDEA.app/Contents/jbr) failed: -6
Note when you work with the path remember to quote properly like so!
vim "/Users/richardmiles/Library/Application Support/JetBrains/IntelliJIdea2022.1/idea.vmoptions"
Related
I have this VM with tomcat, java, and grails in it. I've been getting permgen errors so I looked around and found the solution:
set JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
I use SSH to access the vm and type the arguments above. I suppose that would fix the problem. Thing is, I wanted to make sure that I did it correctly. So I searched again on how I could check the current permSize and this is the solution I got:
jinfo -flag MaxPermSize 6444
6444 is the pid, and as a response, I got this.
-XX:MaxPermSize=85983232
Question: Is the value of the maxPermSize in bytes? because, if it is, then that would mean that the java_opts command didn't work. I am expecting to get 512m but 85983232 bytes = 82 mb.. Or am I seeing it wrong..? Can anybody enlighten me on this? D:
You have to change the values in the CATALINA_OPTS option defined in the Tomcat Catalina start file. To increase the PermGen memory change the value of the MaxPermSize variable, otherwise change the value of the Xmx variable.
Linux & Mac OS: Open or create setenv.sh file placed in the "bin" directory. You have to apply the changes to this line:
export CATALINA_OPTS="$CATALINA_OPTS -server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m"
Windows:
Open or create the setenv.bat file placed in the "bin" directory:
set CATALINA_OPTS=-server -Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512m
Don't put the environment configuration in catalina.bat/catalina.sh. Instead you should create a new file in CATALINA_BASE\bin\setenv.bat to keep your customizations separate of tomcat installation.
So you are doing the right thing concerning "-XX:MaxPermSize=512m": it is indeed the correct syntax. You could try to set these options directly to the Catalyna server files so they are used on server start.
Maybe this post will help you!
How to make sure that Tomcat6 reads CATALINA_OPTS on Windows?
Completely removed from java 8 +
Partially removed from java 7 (interned Strings for example)
source
When I open Intellij 14 , it starts the initial loading and then following is shown in the screen.After that it is vanished and program does not start.
But when I open the task manager it is shown in the Processes as per the below figure.
Sometimes the program starts after about 10 minutes .Sometimes it won't start at all.Can someone give me a solution on how to overcome this problem ?
Just like Tom, I too have increased the memory when IntelliJ asked and regretted it. This is the screen that asked for it:
However, in my case, instead of editing the .vmoptions files in the bin folder, IntelliJ created a new one in my home directory which I can only assume overrides the ones in the bin folder. I would assume this is typical of the new versions - I am using IntelliJ 2016.1 right now.
So, in order to fix this issue, go to C:\Users\<your_username>\.IntelliJIdea<version>\config (or your OS' equivalent) and delete the idea.exe.vmoptions and/or idea64.exe.vmoptions file from there. This should remove the override and have IntelliJ use the settings in the bin folder.
It might be worth checking the files in the bin folder as well, in case IntelliJ changes how it handles these settings.
Here are the default .vmoptions files in the installation's bin folder; you can't delete these as it will prevent IntelliJ from starting:
bin/idea.exe.vmoptions:
-server
-Xms128m
-Xmx512m
-XX:MaxPermSize=250m
-XX:ReservedCodeCacheSize=150m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
bin/idea64.exe.vmoptions
-Xms128m
-Xmx750m
-XX:MaxPermSize=350m
-XX:ReservedCodeCacheSize=225m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
I got an out-of-memory dialog on intellij 15 and took an option on that dialog to increase max memory. Thereafter I could not start intellij. So, I looked in the intellij /bin folder for a pid file (per another stack overflow question) to see what was happening, but I could not find one. There was however a file (idea.exe.vmoptions) that had changed (to hold my new memory setting). So I edited that file to set max memory back to what I had before, and now it works.
You can try to open Intellij on CLI.
cd C:\Program Files\JetBrains\IntelliJ IDEA 2020.1\bin
later then execute this command
idea.bat
Probably Intellij will open. If it will not open then you can see the error message why it will not open on CLI.
Just updated IntelliJ to a newer version, and I followed the 'configure' link to double the memory used for IntelliJ which I later regret. IntelliJ could not restart. Open the system.log (e.g. Use CMD+SPACE_BAR and search 'console' on MacOs, then go to system.log), I can see IntelliJ aborted a few times with an abnormal code 1. Here the lines related to the launch,
Processing VMOptions file at
/Users/[user]/Library/Preferences/IntelliJIdea2019.2/idea.vmoptions
com.apple.xpc.launchd[1] (com.jetbrains.intellij.22016[2971]): Service exited with abnormal code: 1
I can see the path from where IntelliJ loads vm options during the launch.
Checking the bin/ of my IntelliJ application, I can see another version of the idea.vmoptions file that has a slightly older timestamp. By comparing the content of the two files, I now realized that IntelliJ created another vm option file that has only a sub set of options in a newer location which broke the restart. Deleting or just safely renaming the newer file in the [User] sub directory fixed my problem.
C:\Users\<user>\AppData\Roaming\JetBrains\
if you are a Windows user, remove this directory. It helped me
Edit C:\Program Files (x86)\JetBrains\IntelliJ IDEA 15.0.6\bin\idea.exe.vmoptions the Xmx to Xmx512
-server
-Xms128m
-Xmx512m
Following steps helped me to overcome the Java heap size related issues on InteliJ IDEA.
Go to the location where you have installed the IDEA IDE and search for the following file:
idea64.exe.vmoptions
Change it accordingly.
-Xms4196m
-Xmx8092m
-XX:MaxPermSize=1000m
-XX:ReservedCodeCacheSize=1024m
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djsse.enableSNIExtension=false
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
Also be aware of the 32-bit address space limit on Windows which makes it hard to use heap sizes higher than 750m. Should you need to use larger heap, make sure to switch to the 64-bit JVM first, otherwise IDE may crash on start or start to crash randomly during work.
For me, the cause was a bad plugin.
I moved all plugins in below directory to a backup directory, and started IDEA, and it started without an issue.
C:\Users\<username>\AppData\Roaming\JetBrains\IntelliJIdea2021.2\plugins
Then, copied plugins back to the above directory one by one, to identify the broken plugin.
You might also check your IDEA_JDK_64, JAVA_HOME and JDK_HOME environmental variables. In my case I updated Java version and deleted previous directory containing JDK. Then IntelliJ started to dissapear from processes just a few seconds after launch. I changed all paths to point proper JDK directory and then it started to work as it should.
Check the logs for error or issue in the path C:\Users\.IntelliJIdea14\system\log\idea.log.
If that report HeapDumpOnOutOfMemoryError
Go to VM options files in the path C:\Program Files\JetBrains\IntelliJ IDEA 2018.2.6\bin
Increase the -Xms750m to greater value say -Xms900m .
That solve the issue for me
Had a similar issue.
idea64.exe just didn't start silently.
idea.bat printed just IDE is being shut down and didn't start either.
In my case there was no effect of manipulations with idea64.exe.vmoptions, but it helped to find and kill from Task Manager an invisible orphan idea64.exe process.
This solution was hinted by the first comment by #CrazyCoder at https://intellij-support.jetbrains.com/hc/en-us/community/posts/360009511720--Solved-Idea-Community-doesn-t-start-after-update-to-2020-1-4.
I installed the jasperserver(version: 5.6) in Windows 7 through the official document, use an exsiting Tomcat(version: 7) and an existing PostgreSQL(version: 9.2.8), I checked the installation.log file in JasperServer's installation path, and everything is OK.
But when I starting the Tomcat by double click 'Tomcat.exe' and it always says the following error:
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "RMI TCP Connection(idle)"
I searched for these problem and some says to configure the JVM options in %CATALINA_HOME%\bin\setenv.bat or %CATALINA_HOME\bin\%catalina.bat, but I can't find any one of them. I think this is because I'm using an exsiting Tomcat and the installation of JasperServer modified some files in %CATALINA_HOME%. So I searched 'setenv.bat' from %JasperServer% and find it in %JasperServer%\scripts. Here is my configuration:
set JAVA_OPTS=%JAVA_OPTS% -Xms2048m -Xmx3072m -XX:PermSize=1024m -XX:MaxPermSize=2048m -Xss2m -XX:+UseCompressedOoops -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled
Also, I did followed the official document here, and nothing helps, Error exists.
Is there anyone who met the same problem? What should I do? I really need help. Thanks.
It seems like the memory parameters you have specified have not been picked up? Check it out, for example by looking at the process table similar to following example:
ivos-mbp:demo ivomagi$ jps
1562 start.jar
1572 Jps
my-mbp:demo me$ ps axu 1562
USER PID %CPU %MEM VSZ RSS TT STAT STARTED TIME COMMAND
me 1562 0.2 2.8 2965576 230784 s001 S 12:17PM 0:22.62 /usr/bin/java -Dcom.sun.management.jmxremote -Xmx168m
In case you do not see the specified -Xmx3072m in the printout, you need to doublecheck where from the configuration is loaded.
Please, set CATALINA_OPTS instead of JAVA_OPS. Tomcat refers to CATALINA_OPTS on the start:
set "CATALINA_OPTS= -Xms2048m -Xmx3072m -XX:PermSize=1024m -XX:MaxPermSize=2048m -Xss2m -XX:+UseCompressedOoops -XX:+UseConcMarkSweepGC -XX:+CMSClassUnloadingEnabled"
I was trying to adjust initial heap size of a tomcat 7 (CentOS, java -version: 1.6.0_25-b06) instance by adding the following line to catalina.sh:
export CATALINA_OPTS="-Xms=512M -Xmx=1024M"
Starting up tomcat fails and logs the following message to catalina.out:
Invalid initial heap size: -Xms=512m
Could not create the Java virtual machine.
What is wrong with these options?
You must not use =. Simply use this:
export CATALINA_OPTS="-Xms512M -Xmx1024M"
Use following command to increase java heap size for tomcat7 (linux distributions) correctly:
echo 'export CATALINA_OPTS="-Xms512M -Xmx1024M"' > /usr/share/tomcat7/bin/setenv.sh
You might no need to having export, just add this line in catalina.sh :
CATALINA_OPTS="-Xms512M -Xmx1024M"
setenv.sh is better, because you can easily port such configuration from one machine to another, or from one Tomcat version to another. catalina.sh changes from one version of Tomcat to another. But you can keep your setenv.sh unchanged with any version of Tomcat.
Another advantage is, that it is easier to track the history of your changes if you add it to your backup or versioning system. If you look how you setenv.sh changes along the history, you will see only your own changes. Whereas if you use catalina.sh, you will always see not only your changes, but also changes that came with each newer version of the Tomcat.
Go to "Tomcat Directory"/bin directory
if Linux then create setenv.sh else if Windows then create setenv.bat
content of setenv.* file :
export CATALINA_OPTS="$CATALINA_OPTS -Xms512m"
export CATALINA_OPTS="$CATALINA_OPTS -Xmx8192m"
export CATALINA_OPTS="$CATALINA_OPTS -XX:MaxPermSize=256m"
after this restart tomcat with new params.
explanation and full information is here
http://crunchify.com/how-to-change-jvm-heap-setting-xms-xmx-of-tomcat/
After spending good time time on this . I found this is the what the setenv.bat must look like . No " characters are accepted in batch file.
set CATALINA_OPTS=-Xms512m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=768m
echo hello "%CATALINA_OPTS%"
Take care with change in Debian distributions! I tried to change CATALINA_OPTS in my Debian 7 and the results where that tomcat didn't start anymore. Thus I solved this issue by changing the property JAVA_OPTS in place of CATALINA_OPTS, like this
export JAVA_OPTS="-Xms512M -Xmx1024M"
Just came across this and I've implemented Nathan's solution:
add the line (changing the values as required):
export JAVA_OPTS="-Xms512M -Xmx1024M"
to /usr/share/tomcat7/bin/setenv.sh
If that file doesn't exists then create it and
chown root:root it
chmod 755 it
And then restart tomcat and
check it with
ps aux | grep logging
Which should just pick up the instance and show the java parms
It works even without using 'export' keyword. This is what i have in my setenv.sh (/usr/share/tomcat7/bin/setenv.sh) and it works.
OS : 14.04.1-Ubuntu
Server version: Apache Tomcat/7.0.52 (Ubuntu)
Server built: Jun 30 2016 01:59:37
Server number: 7.0.52.0
JAVA_OPTS="-Dorg.apache.catalina.security.SecurityListener.UMASK=`umask` -server -Xms6G -Xmx6G -Xmn1400m -XX:HeapDumpPath=/Some/logs/ -XX:+HeapDumpOnOutOfMemoryError -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:SurvivorRatio=8 -XX:+UseCompressedOops -Dcom.sun.management.jmxremote.port=8181 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false"
JAVA_OPTS="$JAVA_OPTS -Dserver.name=$HOSTNAME"
If it's not work in your centos 7 machine "export CATALINA_OPTS="-Xms512M -Xmx1024M"" then you can change heap memory from vi /etc/systemd/system/tomcat.service file then this value shown in your tomcat by help of ps -ef|grep tomcat.
I'm running a ".bat" file which points to asant:
C:\Sun\SDK\bin\asant Startbds
asant again points to a xml file i've got, build.xml:
<target name="Startbds" description="Start bds">
This has been fine for now, but now i have added more data, which leads to an out of memory error:
java.lang.outOfMemoryError: Java heap space
So i've tried to increase the heap space by various methods i've found while searching around for a solution:
cmd: set ANT_OPTS=-Xms512m -Xmx512m (did not work, same error message)
Editing the asant.bat where i edited the line "-set ANT_OPTS" from
.
set ANT_OPTS="-Dos.name=Windows_NT" -Djava.library.path=%AS_INSTALL%\lib;%AS_ICU_LIB%;%AS_NSS%" "-Dcom.sun.aas.installRoot=%AS_INSTALL%" "-Dcom.sun.aas.instanceRoot=%AS_INSTALL%" "-Dcom.sun.aas.instanceName=server" "-Dcom.sun.aas.configRoot=%AS_CONFIG%" "-Dcom.sun.aas.processLauncher=SE" "-Dderby.root=%AS_DERBY_INSTALL%"
TO
set ANT_OPTS="-Xms512m -Xmx512m" "-Dos.name=Windows_NT" -Djava.library.path=%AS_INSTALL%\lib;%AS_ICU_LIB%;%AS_NSS%" "-Dcom.sun.aas.installRoot=%AS_INSTALL%" "-Dcom.sun.aas.instanceRoot=%AS_INSTALL%" "-Dcom.sun.aas.instanceName=server" "-Dcom.sun.aas.configRoot=%AS_CONFIG%" "-Dcom.sun.aas.processLauncher=SE" "-Dderby.root=%AS_DERBY_INSTALL%"
but this gave me the error message:
"Invalid initial heap size: -Xms512m -Xmx512m
Could not create the Java virtual machine."
Anyone got an idea of how i should increase the heapsize?
And maybe also give a pointer to where i can find a tool to watch the heapsize.
Thanks in advance.
By using "-Xms512m -Xmx512m" you gave a single argument. -Xms expects the minimum heap size to be specified by the rest of the argument. So you defined the minimum heap size to be "512m -Xmx512m", which is not a valid value.
You will want to provide those switches as two arguments:
set ANT_OPTS=-Xms512m -Xmx512m "-Dos.name=Windows_NT" ...
I think that if you're in windows, you don't need the double quotes in your set.
Here is an example I saw somewhere:
set ANT_OPTS=-Xms512m -Xmx512m (Windows)
export ANT_OPTS="-Xms512m -Xmx512m" (ksh/bash)
setenv ANT_OPTS "-Xms512m -Xmx512m" (tcsh/csh)
As for monitoring heap usage, if you are using the most recent JDK on Windows, you should have Sun's VisualVM.
In eclipse -> window -> preferences -> Tomcat -> JVM Setting -> Append to JVM Parameters:
-XX:MaxPermSize=512m
-Xms512m
-Xmx512m