6/07/2006

6 Common Errors in Setting Java Heap Size

Two JVM options are often used to tune JVM heap size: -Xmx for maximum heap size, and -Xms for initial heap size. Here are some common mistakes I have seen when using them:

  • Missing m, M, g or G at the end (they are case insensitive). For example,
    java -Xmx128 BigApp
    java.lang.OutOfMemoryError: Java heap space
    The correct command should be: java -Xmx128m BigApp. To be precise, -Xmx128 is a valid setting for very small apps, like HelloWorld. But in real life, I guess you really mean -Xmx128m

  • Extra space in JVM options, or incorrectly use =. For example,
    java -Xmx 128m BigApp
    Invalid maximum heap size: -Xmx
    Could not create the Java virtual machine.

    java -Xmx=512m HelloWorld
    Invalid maximum heap size: -Xmx=512m
    Could not create the Java virtual machine.
    The correct command should be java -Xmx128m BigApp, with no whitespace nor =. -X options are different than -Dkey=value system properties, where = is used.

  • Only setting -Xms JVM option and its value is greater than the default maximum heap size, which is 64m. The default minimum heap size seems to be 0. For example,
    java -Xms128m BigApp
    Error occurred during initialization of VM
    Incompatible initial and maximum heap sizes specified
    The correct command should be java -Xms128m -Xmx128m BigApp. It's a good idea to set the minimum and maximum heap size to the same value. In any case, don't let the minimum heap size exceed the maximum heap size.

  • Heap size is larger than your computer's physical memory. For example,
    java -Xmx2g BigApp
    Error occurred during initialization of VM
    Could not reserve enough space for object heap
    Could not create the Java virtual machine.
    The fix is to make it lower than the physical memory: java -Xmx1g BigApp

  • Incorrectly use mb as the unit, where m or M should be used instead.
    java -Xms256mb -Xmx256mb BigApp
    Invalid initial heap size: -Xms256mb
    Could not create the Java virtual machine.
  • The heap size is larger than JVM thinks you would ever need. For example,
    java -Xmx256g BigApp
    Invalid maximum heap size: -Xmx256g
    The specified size exceeds the maximum representable size.
    Could not create the Java virtual machine.
    The fix is to lower it to a reasonable value: java -Xmx256m BigApp

  • The value is not expressed in whole number. For example,
    java -Xmx0.9g BigApp
    Invalid maximum heap size: -Xmx0.9g
    Could not create the Java virtual machine.
    The correct command should be java -Xmx928m BigApp
PS:

How to set java heap size in Tomcat?
Stop Tomcat server, set environment variable CATALINA_OPTS, and then restart Tomcat. Look at the file tomcat-install/bin/catalina.sh or catalina.bat for how this variable is used. For example,
set CATALINA_OPTS=-Xms512m -Xmx512m  (Windows, no "" around the value)
export CATALINA_OPTS="-Xms512m -Xmx512m" (ksh/bash, "" around the value)
setenv CATALINA_OPTS "-Xms512m -Xmx512m" (tcsh/csh, "" around the value)
In catalina.bat or catallina.sh, you may have noticed CATALINA_OPTS, JAVA_OPTS, or both can be used to specify Tomcat JVM options. What is the difference between CATALINA_OPTS and JAVA_OPTS? The name CATALINA_OPTS is specific for Tomcat servlet container, whereas JAVA_OPTS may be used by other java applications (e.g., JBoss). Since environment variables are shared by all applications, we don't want Tomcat to inadvertently pick up the JVM options intended for other apps. I prefer to use CATALINA_OPTS.

How to set java heap size in JBoss?
Stop JBoss server, edit $JBOSS_HOME/bin/run.conf, and then restart JBoss server. You can change the line with JAVA_OPTS to something like:
JAVA_OPTS="-server -Xms128m -Xmx128m"
How to set java heap size in Eclipse?
You have 2 options:
1. Edit eclipse-home/eclipse.ini to be something like the following and restart Eclipse.
-vmargs
-Xms64m
-Xmx256m
2. Or, you can just run eclipse command with additional options at the very end. Anything after -vmargs will be treated as JVM options and passed directly to the JVM. JVM options specified in the command line this way will always override those in eclipse.ini. For example,
eclipse -vmargs -Xms64m -Xmx256m
How to set java heap size in NetBeans?
Exit NetBeans, edit the file netbeans-install/etc/netbeans.conf. For example,
netbeans_default_options="-J-Xms512m -J-Xmx512m -J-XX:PermSize=32m -J-XX:MaxPermSize=128m -J-Xverify:none
How to set java heap size in Apache Ant?
Set environment variable ANT_OPTS. Look at the file $ANT_HOME/bin/ant or %ANT_HOME%\bin\ant.bat, for how this variable is used by Ant runtime.
set ANT_OPTS=-Xms512m -Xmx512m  (Windows)
export ANT_OPTS="-Xms512m -Xmx512m" (ksh/bash)
setenv ANT_OPTS "-Xms512m -Xmx512m" (tcsh/csh)
How to set java heap size in jEdit?
jEdit is a java application, and basically you need to set minimum/maximum heap size JVM options when you run java command. jEdit by default runs with a default maximum heap size 64m. When you work on large files, you are likely to get these errors:
java.lang.OutOfMemoryError: Java heap space
at java.lang.String.concat(String.java:2001)
at org.gjt.sp.jedit.buffer.UndoManager.contentInserted(UndoManager.java:160)
at org.gjt.sp.jedit.Buffer.insert(Buffer.java:1139)
at org.gjt.sp.jedit.textarea.JEditTextArea.setSelectedText(JEditTextArea.java:2052)
at org.gjt.sp.jedit.textarea.JEditTextArea.setSelectedText(JEditTextArea.java:2028)
at org.gjt.sp.jedit.Registers.paste(Registers.java:263)

How to fix it? If you click a desktop icon, or Start menu item to start jEdit: right-click the icon or menu item, view its property, and you can see its target is something like:
C:\jdk6\bin\javaw.exe -jar "C:\jedit\jedit.jar"
You can change that line to:
C:\jdk6\bin\javaw.exe -Xmx128m -Xms128m -jar "C:\jedit\jedit.jar"
If you run a script to start jEdit: just add these JVM options to the java line inside the script file:
java -Xmx128m -Xms128m -jar jedit.jar
If you start jEdit by running java command: just add these JVM options to your java command:
java -Xmx128m -Xms128m -jar jedit.jar
Note that when you run java with -jar option, anything after -jar jar-file will be treated as application arguments. So you should always put JVM options before -jar. Otherwise, you will get error:
C:\jedit>java -jar jedit.jar -Xmx128m
Unknown option: -Xmx128m
Usage: jedit [options] [files]
How to set java heap size in JavaEE SDK/J2EE SDK/Glassfish/Sun Java System Application Server?
Stop the application server, edit
$GLASSFISH_HOME/domains/domain1/config/domain.xml, search for XML element name java-config and jvm-options. For example,
<java-config suffix="...">
<jvm-options>-Xmx512m</jvm-options>
<jvm-options>-XX:NewRatio=2</jvm-options>
<jvm-options>-XX:MaxPermSize=128m</jvm-options>
...</java-config>
You can also change these settings in the web-based admin console, typically at http://localhost:4848/, or https://localhost:4848/. Go to Application Server near the top of the left panel, and then on the right panel, click JVM Settings | JVM Options, and you will see a list of existing JVM options. You can add new ones and modify existing ones there.

Yet another option is to use its Command Line Interface (CLI) tool command, such as:
./asadmin help create-jvm-options
./asadmin help delete-jvm-options
They may be a bit hard to use manually, but are well suited for automated scripts.

148 comments:

Anonymous said...

I got some, i got some! How about Xmx256m without minus, how about -Xmxtwohundredfiftysixmegas, how about -Xmxshowmesomelove?

Klaus Meffert said...

In opposition to the anonymous poster, I like your blog entry. Some days ago, I just ran over the problem coming up when you just use the Xms option. I'm sure many people had problems using these options. Maybe they should be reworked by Sun.

howto said...

Thanks for the comments. Admittedly, these errors are not hard to solve, if you look carefully enough. By putting them together, I hope to save people and myself some headaches in the future.

To the first anonymous commenter, I'm glad you got some and more :)

K.C. said...

Your Eclipse example should drop the -vmargs from the eclipse.ini file. When I add it, Eclipse refuses to start. You just need the -Xms128m...

R.P. Aditya said...

if you are on a 64-bit platform you can use a larger heap, but the Sun JVM requires you to specify -d64 to use the 64-bit data model

Anonymous said...

I have a finished application ready for distribution - xxx.jar

This app reads large amounts of data into a JTextArea. Very large amounts of data causes OutOfMemory exceptions.

I DO NOT want to run :
java -Xmx1024M -jar xxx.jar via a shortcut or batchfile, as this leaves a cmd window open.

Any way to spesify the Xmx/Xms values for the client JVMs via env variables? Or, is it possible to set the Xmx value programatically inside the app?

Thanks

admin said...

"Any way to spesify the Xmx/Xms values for the client JVMs via env variables? Or, is it possible to set the Xmx value programatically inside the app?"

No easy way around. You may want to consider using Java Webstart/JNLP.

DiablosDevil said...

Having read to put '-Xmx=256m' (which as you point out shouldn't have an '=') off the official Java forum, it's nice to see some correct information. Great help, thanks!

John said...

If you are running under cygwin you may need to change the run.sh or .conf file containing your options to unix format. If it is in DOS format there will be an extra linefeed character invisibly attached to the end of one of your options.

Anonymous said...

Thats was very useful.. got almost all information that I was looking for... Thanks a lot...

Regards
Surya

hownow said...

Very useful, except that I searched from Google and took the information from the search results (as I often do) and couldn't understand why "Xmx=256m" wouldn't work until I actually read the article :-)

Good work!

George said...

Something to be aware of:

Changing the Eclipse.ini vmargs changes the heap size used to run ECLIPSE

Changing the vmargs inside the "Run as.." menu in Eclipse changes the heap size used to run THE PROGRAM YOU ARE DEVELOPING

very important distinction to make

Manfred said...

Thanks George! (I just lost one hour figuring out how to change the heap for the PROGRAM and NOT for eclipse)

Just for completion:
Run As -> Open Run Dialog ->
-> (x)=Arguments -> VM Arguments

XaviF said...

Thanks you a lot, this information is what i'm looking for.

Very nice job!


Congrats.
Xavi.

Anonymous said...

For Windows, you can add a system or user based environment variable called _JAVA_OPTIONS and set the values you want, for example -Xmx1G. When you run a java app, the jvm will pick up the vm options from _JAVA_OPTIONS.

Haven't seen how to set VM options from within an app...

javahowto said...

Thanks for the above tip about using _JAVA_OPTIONS environment variable.

This works also on Linux and Solaris, as well as Windows.

C:\tmp>set _JAVA_OPTIONS="-Dname=javahowto"

C:\tmp>java A
Picked up _JAVA_OPTIONS: "-Dname=javahowto"

Russoue said...

Great post! Thanks!

Does the maximum heap size in eclipse.ini file affects the heap size of the programs it run or is it just to run itself?

javahowto said...

To Russoue,

No, eclipse.ini settings won't affect running apps inside eclipse.

Please see an earlier comment by George

Russoue said...

Oh, I missed it. Thanks for pointing that out to me.

Anonymous said...

I have 1 GB total space; out of which only 366 mb is free. In such case what argument should i use
-- currently i am using
-vmargs -Xmx1024m

It's frequently gives error for compiling whole prject (670 mb)
and exits from workbench
What should be the best arguments suitable for such situation

Dan said...

setting the _JAVA_OPTIONS environment variable doesn't seem to work for JNLP/Java Web Start applications. Anyone have any thoughts there?

thanks

Anonymous said...

Hi,
I try to setup some parameters for my applet, and I would like to know which of them is right:

*param name="vmargs" value="-Xms40m"**param name="vmargs" value="-Xmx1024m"*
or
*param name="Xms" value="256m"**param name="Xmx" value="1024m"*
or
*param name="Xms" value="256"**param name="Xmx" value="1024"*
or
*param name="-Xms" value="256m"**param name="-Xmx" value="1024m"*
or
*param name="-Xms" value="256"**param name="-Xmx" value="1024"*

Thank you for your information
Panchito

PS I had to replace the tag symbol by * symbol

javahowto said...

You can set it at users' end with Java Control Panel ($JAVA_HOME/jre/bin/ControlPanel) | Java Applet Runtime Setting, adding -Xmx256m to the Java Runtime Parameters column.

This change will apply to all applets running with this Java plugin.

Another option is applet developers specify memory settings for all clients of this applet. I suspect this is only available in Java SE 6 Update 10 Beta, and may not be available in official JDK 6 releases yet. The syntax is:

<APPLET ...>
<PARAM name="java_arguments" value="-Xmx128m"/>
/<APPLET>

See https://jdk6.dev.java.net/plugin2/#NEW_PARAMETERS

Anonymous said...

thankx a lot, I have some problems when I display big images in my applet, I will try to setup the heap max in order to your info to solve it.

Panchito

laptop battery said...
This comment has been removed by a blog administrator.
Felipe said...

Hi, thank you very much for this post, I find it very useful! I have problems of out of memory errors. I have a computer with 16 Gb of RAM memory. I use these commands to run the program: -Xmx3000m -Xms500m, but I get "The jvm could not be initialized", and if I reduce the maximum heap to 2600m I get and out of memory error. What can I do to solve this? thank you in advance!

javahowto said...

On typical 32 bit machines the maximum amount of usable RAM is about 4G, of which about half is reserved for OS. Unix OS reserves less amount memory and leaves more to applications. That may explains why it errors when you specify more than 2G for java VM process.

But in my experience, 1G is a LOT of memory for large java apps. Anything over that, the benefit of increasing memeory diminishes, and may be time to consider scale your app horizontally.

emjs said...

I have a problem with "out of memory" errors using Tomcat4.1. I have used your CATALINA_OPTS settings to see if this helps. On restart I notice that tomcat.exe is still only claiming 85MB of memory under taskmgr. With -xms set to 512m I would have thought this should be the value claimed by tomcat.exe. Should I be looking to see if my -xms value has taken effect in another way?

Anonymous said...

Is it any optimistic heap memory size there? or we can use any memory sizr?

hyoga said...

can you help me with this :
--------
Invalid initial heap size: -Xms4g
The specified size exceeds the maximum representable size.
Could not create the Java virtual machine.
--------
how is the max initial heap ?
fyi : im running solaris 10 with 32GB memory

thanks

dkmiberlin said...

we have a java app that runs our call center connection to the pbx. We would occasionally get an out of memory error on the cmd line box that shows up and would totally crash that app. We would then have to close it and restart it then it would run fine. Our command line bat was using the -Xmx512m switch. My thought was to increase this to -Xmx1g to give it a higher ceiling. when i did that i also added the Xms1g switch as well thinking that would in effect allocate that sytem memory to that app. when i did this it would only take 5-10 minutes to reach an out of memory error. Why would i get the error more frequently when i raised the Xmx? The java.exe process just grows and grows throughout the day. Any advice to make this more stable would be appreciated. We also wouldn't mind paying someone that knows Java and Jar files to take a look at our system and tell us what the problem is.my email is dkimberlin@bluefishtv.com

javahowto said...

If you haven't done so, try a static analysis tool such as BugFinder, or PMD to find any common memory leaks.

Next, try a java Profiler (OptimizeIt, JProbe, and even NetBeans comes with one) on a test machine. Pay attention to objects with abnormally high number of instances.

As your app is connected to pbx, jni may be a factor too.

uiyui said...
This comment has been removed by a blog administrator.
ELB said...

Thanks for this great article.
Starting my appli with -Xmx1500m leads to an OutOfMemory at runtime.
However, the appli works fine with -Xmx500m.
I can't see why this can happen (though there must be a good reason). Any idea ?

Anonymous said...

Hi all, I have a strange problem with CA-7 invoke a dummy java program through its CA-7 agent:

CA-7 can not run:
java -Xms2048M -Xmx2048M HelloWorld

CA-7 can not run:
java -Xms1536M -Xmx2048M HelloWorld

But it can run:
java -Xms2048M -Xmx1536M HelloWorld

(heap size errors).

We have no problem manually run it.

Our actual program run in production. Recently we had our datacenter migration and upgraded CA7.

I dumped the environment before it invoke the program. The environment variables are identical to those we run manually.

Any idea?

Thanks

Any ideas?
Thanks

Anonymous said...

Continue on my early post ...

We have 16GB total memory and 12GB available.

System setting has no limit on memory usage (at least we can run manually).

Thanks.

Anonymous said...

Thank you for all the useful information

Anonymous said...

George's Eclipse related tip, made me a star before my colleague today. 1.5 years later, my thanks.

Bhushan Bhangale said...

Informative content on setting heap size

Anonymous said...

Thanks a lot, George !

Anonymous said...

Good article, thank you.
I do have a Noob question...
If you have a sec... could you please explain what 'BigApp' does with regards to the parameters?.?
Is it a comment? ..or does it have a real effect?
Thanks in advance!

javahowto said...

BigApp is just the main class name, with default package. It can be replaced with any other name. It is not related to the memory settings.

PKS said...

Thanks a lot buddy... Your blog is very helpful in giving valuable info..... keep the good work going....

Sunil said...

I have Sun One Application server running on solaris 10. I am getting the same error and I got the recommendation to set the following settings.
I recommend that you change your Server's heap size from -Xms2g -Xmx2g to -Xms2048m -Xmx2048m and then restart the application server.
My question is, what is the difference in specifying 2048m versus 2g? are they not same?
can i increase it to upto 4g on 32 bit solaris machine? thanks

javahowto said...

I don't see any diff between -Xms2g -Xmx2g and -Xms2048m -Xmx2048m.

This is JVM option so the fact that you are running Sun Application Server shouldn't matter.

Sunil said...

Thanks JavaHowto. So I can change my heap size to 4g on solaris 32 bit. I have total of 8g available on my box. I read some posts stating that JVM can only use upto 2g. Does it make any difference? Thanks for your insights.

Sunil said...

Hello, I am running sunone app server on solaris. In my domain xml, heap size is allocated to 512m. For my node manged server(server1), heap size is allocated to 2g. Total RAM on this server is 8g. My app runs on node managed server1. My app is getting out of memory-heap error. How can I fix this? Is the above settings correct. thanks in advance

javahowto said...

Sunil, pls see http://weblogs.java.net/blog/sdo/archive/2007/12/a_glassfish_tun.html

and

http://docs.sun.com/app/docs/doc/819-3681

for more info on performance tuning with SunOne Application Server

Miguel said...

Very good post, you have save to me with it.

Thank you

rajesh said...

setting heap size in starttomcat - http://hiox.org/index.php?id=443

abhishek said...

Hi,
thanks for your info about .ini for eclipse,
it really worked for me.

Khandelwals said...

I have a huge data to put into Excel file, sometime rise up to 60k. it generate text data about 150MB. What would you do ? My user want to download that file. I know its ridiculous size for manual reading.

Please let me know if anyone has any solution.

Thanks
Ajay

Khandelwals said...

correction above...

at 60k ...it should be 60k Rows.

Thanks
Ajay

javahowto said...

Compress it, and let users download zip, gzip, b2, etc. Some have better compression rate than others.

javasrus said...

Javahowto,

thanks for your comment.
When compress, you start creating another compy of the same data in memory, increase in the use of memory, ...thats when it fails.

Thanks
Ajay

javasrus said...

Also, to zip it up, it has to be written on the disk, or unless you tell me you can zip the half cooked file, and actually that's when it fails.... I will share the code tomorrow.

Wheaties said...

ks

Purohit D said...

useful information for java developers for making software application on Java platform.

theRipper said...

For people questionning how to manage heap size parameters directly from the application : it's "too late" to set such settings on the jvm once the process is started. However the alternative is to use a launcher. On windows I'm using 'launch4J', that allows you to create an exe file out of a jar, specifying such jvm parameters (+ the application icon, version and copyright info, etc...). The exe will look for the jvm on windows then will execute the jar main class with your selected parameters.

Aschwin Versteegden said...

Sorry for asking this Noob question.
When I add Xms param I do this in the following section in the catalina.bat:

:doStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
set CATALINA_OPTS="-Xms512m -Xmx512m"

when I do this Tomcat won't start up it neither shows any logging at all.

before the section I edited said :

:doStart
shift
if not "%OS%" == "Windows_NT" goto noTitle
set _EXECJAVA=start "Tomcat" %_RUNJAVA%
set CATALINA_OPTS=

so the CATALINA_OPTS param was already set but with no value.
What is wrong here?

Aschwin Versteegden said...

Oke oke It wasn't me being a noob
Sorry here but your example said:
set CATALINA_OPTS="-Xms512m -Xmx512m"
In my case it should have been:
set CATALINA_OPTS=-Xms512m -Xmx512m
So that was very nice clearing a problem by just deleting quotes :-)
Too bad it took me over an hour or so to figure that out :-(

javahowto said...

Thanks for catching the problem with quotes. I've fixed the CATALINA_OPTS and ANT_OPTS.

So we should NOT quote the value when setting environment variables on Windows. But on Unix, we SHOULD quote the environment variable values when they contain white spaces.

Anonymous said...

In response to: I DO NOT want to run :
java -Xmx1024M -jar xxx.jar via a shortcut or batchfile, as this leaves a cmd window open.

you can run javaw -Xmx1024M -jar xxx.jar. this does not leave a cmd window open.This is the right way to prevent viewing cmd windows behind the app.

Purohit D said...

I appreciate the information. Java is one of the consistent player from the development industry which has been providing the wider scope for developers to come out with different solutions.

Purohit D said...

Sun Java is one of the most flexible platform for application development Sun Java development gives the way to develop complex applicaton development.

yipeng said...

I have tried setting -Xms128m -Xmx2048m but still get the following error:

Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

While trying to parse a 700mb file inside eclipse. Anyone have any ideas for me?

Henry said...

Comments here are very good ones. It help resolve the errors I had while building spring framwork on my 2 G RAM laptop

Thanks everyone.

Edo

Anonymous said...

Thank you very much. this post has been very useful to me (and many others).

Green Parks said...

Hello.. Firstly I would like to send greetings to all readers. After this, I recognize the content so interesting about this article. For me personally I liked all the information. I would like to know of cases like this more often. In my personal experience I might mention a book called Green Parks Costa Rica in this book that I mentioned have very interesting topics, and also you have much to do with the main theme of this article.

caverta said...

Thank you very much. this post has been very useful to me (and many others).

Rossignol Axium SKI said...

thanks !! very helpful post!

semika said...

Good post. Thank you so much

Ankur said...

Thanks -- it's good to know that fractional memory sizes aren't allowed.

Ashok said...

Great Post... Solved my problem.

dugi's guide said...

Nice work on putting together a very interesting post. Fabulous ideas and very helpful information. Well thought out and well written.

Anonymous said...

turbulence training
nice post thanks for sharing....

Tim said...

I'm running a .jar through a Windows shortcut. Can I specify a maximum heap size in the shortcut, and if I can, what would the correct syntax be?

javahowto said...

@Tim: no. The best you can do is to write a .bat file to wrap the java command.

kamagra online said...

Hello,
Your blog contains very useful information. Thanks very much for sharing this amazing blog post, Keep updating your blog regularly... I'm looking forward to your new posts.

Thanks!

Joe said...

Awesome blog.. for jedit's right click, edit the HKEY_LOCAL_MACHINE\SOFTWARE\Classes\*\shell\Open with jEdit\Command key to include the Xmx too!

buy kamagra said...

Amazing information.Keep posting and sharing such kind of topic.

Dylan Rebert said...

You are a very smart person!

Vijay Pandey said...

i have set the parameter in eclipse.ini file but i still facing the same problem "Exception in thread "main" java.lang.OutOfMemoryError: Java heap space"
Plz guide to me

gringo_starr said...

Thanks for good summary. I would add one more type of mistake that happend to me: in Windows Maven2 settings this does't work:

set MAVEN_OPTS="-Xms512M -Xmx512M -XX:MaxPermSize=512m"

JVM produces misleading error notification: "Invalid initial heap size: -Xms512M -Xmx512M -XX:MaxPermSize=512m"

The problem is with the quotations marks. One should instead use:
set MAVEN_OPTS=-Xms512M -Xmx512M -XX:MaxPermSize=512m

Javin @ eclipse remote debugging said...

Indeed most practical and insightful
tips.

Javin
5 tips on writing equals method in Java

Alpha0 said...

THere is one more common problem which people do is to put double quotes around the params on windows - which is wrong.
Just to confirm whether you could set the memory correctly, use jconsole and connect to your running application. You will be able to see if the memory limits are correctly set

Beth said...

Java is crazy! I can't stand using it, makes me think I need health supplements!

rajeev said...

Good post and the information shared are useful...

Thanks a lot...Keep doing these kind of work.

java arraylist tutorial said...

Nice article just to add Many people confused between Java heap and stack though both represent memory they are completely different to each other. Stack is where local variable are cretead or method stack trace are stored while heap is the memory where JVM stores objet.

SOK PHEARIN said...

Great job!!!
Thank you very MUCH!!!

Regards,
William

Abilene Roofing Company said...

Really great post, Thank you for sharing This knowledge.Excellently written article, if only all bloggers offered the same level of content as you, the internet would be a much better place.

alprazolam online said...

Hi, This is really nice information here.... very interesting too... Thanks for the share....

iulian said...

My file is
-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
512M
-showsplash
org.eclipse.platform
--launcher.XXMaxPermSize
512m
--launcher.defaultAction
openFile
-vmargs
-Dosgi.requiredJavaVersion=1.5
-Xms64m
-Xmx1024m

It said it can't start

Javin @ core java interview questions answers said...

good one mate, by the way here is mine way of solving java.lang.outofmemoryerror permgen space

buy xanax online said...

Great articolo, è stato a great helpufl! Ho appena iniziato e conoscere meglio qui! Cheers, il buon lavoro keep you!

lesbian bondage videos said...

Great website, looks very clean and organized. Keep up the good work!

Rummy Online said...

Hi , i got this Article , i was searching some thing relevant to this, And i am feeling lucky, as its the perfect one for what i am looking for. I will share this link on face book.

cazare sulina said...

such a good language: java?

Cheap wedding dresses said...

I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts.

Skater Stuff said...

i get this error



java -version
Picked up _JAVA_OPTIONS: .-Xms32m
Unrecognized option: .-Xms32m
Could not create the Java virtual machine.


what dose it mean?

dev said...

Hi Guys,
I am using Windows server 2008 64 bit , 12 GB RAM. Tomcat 7.0.22 64-bit. I want to increase heap size to 8 GB. I have created environment variable JAVA_OPTS and value part : -Xms512m -Xmx8192m after that i have also tried CATALINA_OPTS but it is also not reflecting the changes. In task manager java is using only upto 256 MB. Can any one please help me out to increase the heap memory in 64 bit machine.

juegos de futbol said...

This is a wonderful post. I enjoyed the information lot. I will bookmark this page.Thanks for sharing this important information.

Seminariruumid said...

I like to spend my free time by reading various internet resources. Today I came across your blog and I found it is as one of the best free resources available! Well done! Keep on this quality!

Seminariruumid said...

It took me time to analyze most of the feedback, but I honestly love the content. The idea proved to be very useful to me and I am sure to most of the bloggers out there! It feels good when you can not just be told, but you will also be entertained! I’m confident you had felt joy penning this post.

Waheed وحيد said...

In Netbeans to set your application heap size you need to go to right click on the project, select Properties then Run/VM-Options
and add your configuration opetions there.
The NB configuration file mentioned above is for NB it self.
Thanks for your article.

Anonymous said...

Excellent article! Just what I wanted and the way I wanted!! Kudos to you!

Kingitused said...

I'm really impressed with the content you provided. It's really helpful for me and I'm sure for others as well. Keep it up.

Anonymous said...

Good one... I have seen some good article at https://www.logicsmeet.com/forum/Core%20Java/21792-Error-occurred-during-initialization-of-vm-jboss.aspx

Thanks,

Anonymous said...

On aix, the variable IBM_JAVA_OPTIONS works, instead of _JAVA_OPTIONS.

Anonymous said...

thank you for this blog. helped me alot. i just have one question plz. from a clean boot into my centos web server. at the prompt i type 'java'. not even loading a jar app. just plain 'java' or 'java -version'. and i get the dreaded 'cant reserve enough space for object heap'. where is the global java/jvm settings file so that i can adjust the heap size as per your guidelines above?

javahowto said...

Can you try "which java", just to see the exact executable. Also check if the executed java executable is compatible with your OS and hardware, 32 bit or 64 bit, etc.

adeel said...

Thanks for the no-double-quotes for windows tip on max heap size for tomcat

jerseys cheap said...

Thanks for the comments. Admittedly, these errors are not hard to solve, if you look carefully enough. By putting them together, I hope to save people and myself some headaches in the future.

Pierre-Hugues Charbonneau said...

Very complete article on Java heap size. Your readers may also be interested in more tips on how to tune the Java heap; especially for a Java EE environment.

Thanks.
P-H

Anonymous said...

I was able to set the java java heap space on windows via the java control panel runtime parameters, but these get wiped out if you restart the machine.

-Xms1024m -Xmx1024m

How do you make these runtime parameters permanent?

Anonymous said...

Nice, this is very helpful. If you are running jar you should try this one "java -jar -Xms512m C:\locationOfYourJar" with out the double quotes

Sunsoft Shanmugam said...

Great Works,
valuable information about java setup
Thank you
php development company

saransh khanna said...

Thanks for the great information..




Php Development Company

Sergey Isterin said...

Thank you.Thats was very useful

Best Games said...

Thanks for giving useful information.

Poker game said...

Thanks for giving useful information.

Subham said...

good post !! Keep it up

toko online said...

thanks for the info by reading this article I know a lot of things

play rummy online said...

This is a wonderful post. I enjoyed the information lot.

jual obat bius said...

thanks for the article information is very useful for me

jivko stefanov said...

I think this is one of the best information about java WebStart that I read and this is not only my opinion,even OKL company and http://www.webstart.com.pl/ comfirmed it.

Lunch Tiffin Service Navi Mumbai said...

Nice post and very informative article. I have been a regular visitor of your post. Your posts with various topics have touched me, so please keep posting..
Tiffin Services in Navi Mumbai

Anna said...

Great and Useful Article.

Online Java Course

Java Online Training

Java Course Online

J2EE training

online J2EE training

Best Recommended books for Spring framework

Java Interview Questions












Java Training Institutes in Chennai

Java Training in Chennai

J2EE Training in Chennai

java j2ee training institutes in chennai

siddu said...

Thank you for sharing helpful information.

online java training
online advanced java training
online core java training

1croreprojects said...



Thanks for sharing this valuable information.
java projects in chennai
dotnet projects in chennai
ns2 projects in chennai

حسام داود said...

شركة تسليك مجاري المطبخ بالرياض
شركة تسليك مجارى الحمام بالرياض
level تسليك المجاري بالرياض
افضل شركة تنظيف بالرياض
تنظيف شقق بالرياض
شركة تنظيف منازل بالرياض
شركة غسيل خزنات بالرياض
افضل شركة مكافحة حشرات بالرياض
رش مبيدات بالرياض
شركة تخزين عفش بالرياض
شركة تنظيف مجالس بالرياض
تنظيف فلل بالرياض
ابى شركة تنظيف بالرياض

Steve Mendoza said...

Nice article thanks for sharing.
Generic Viagra

buy modafinil online said...

Your articles are very helpful and i thank you for your amazing insights. Kindly share few more blogs on the topic.

SEO PARTNERS said...

aشركة مكافحه حشرات بالدمام
متخصصه في اباده جميع انواع الحشرات الطائره والزاحفه والقوارض باستخدام افضل الطرق في مكافحه الحشرات
يوجد لدي شركتنا فريق متخصص في القيام باعمال المكافحه ويستخدم افضل الطرق العالميه
ويستخدم مواد ليها بها مواد مسمسه وليس لها ضرر علي صحه الانسان لقد اصبحت الفئران تهددنا مما تنقلها من الامراض
وايضا البكتريا والاخطار التي تسببها من فيروسات لذلك اصبحت عمليه مكافحه الفئران وجمييع الحشرات لازمه
لذلك عليك السرعه التامه في التعامل مع شركتنا للقضاء علي الحشرات
النظافه شئ لا غني عنها في كل بيت فالنظافه تدل علي الاشخاص الموجدين بالمنزل
وتعتبر مصدر مشرف لهم لذلك تحرص كل ست بيت علي تنظيف المنزل
ولان عمليه التنظيف عمليه شاقه فلا داعي للتعب مع شركة تنظيف بالدمام
لان شركتنا توفر لكم افضل فريق عمل متخصص في عمليات التنظيف
وهذا الفريق مدرب علي احداث وسائل التنظيف فلا داعي للقلق واتكي ذمام الامرور لنا
شركة مكافحة حشرات بالاحساء
تضمن لكم القضاء علي جميع انواع الحشرات ولان صحتك تهما تستخدم الشركه مواد تم عمل اختبار لها
و هذه المواد حاصله علي موافه من وزاره الصحه فلا داعي للقلق علي صحتك وصحه اولادك بعد الان
تقدم لكم الشركه افضل العروض وافضل الاسعار التي تناسب جميع العملاء
كما ان الشركة تقدم لكم متابعه دوريه و ضمان لعدم رجوع الحشرات مره اخري باعلي جوده والخدمه لا تتطلب منك مغادره المنزل
شركة تنظيف بالاحساء
تقدم لكم افضل خدمه تنظيف تستخدم الشركه تقنيات عالميه في التنظيف
كما ان الشركه تستخدم تقنيات البخار التي تعمل علي ازاله الاتربه ورجوع كل شئ كانه جديد
كما ان الشركه تقوم بتنظيف جميع انواع السجاد والموكيت والستائر والمجالس والكنب وتستخدم الشركه لكل نوع المواد التي تناسبه
وهذه المواد ليس لها ضرر علي الاقمشه بل تعمل علي ثبات الالوان كما ان الشركه اسعارها ليس لها منافس لان اسعاره تناسب جميع العملاء

Chandra Shekhar Goka said...

Well said I have also find the same tutorials here also CompleteCoreJava

mithila anderson said...

In most kinds of investment, the investor in fact buys an asset and also monitor its value. In the event the investor sells the asset returning to the market when its price moved up, he has produced a profit. If he sells it if the price has dropped, he's got made a loss. Binary Trading Options There is certainly the actual movement with the asset here, with its added responsibilities for the investor.

Karthika Shree said...

Excellent and very cool idea and the subject at the top of magnificence and I am happy to this post..Interesting post! Thanks for writing it.What's wrong with this kind of post exactly? It follows your previous guideline for post length as well as clarity.
Java Training in Chennai

asmaa ahmad said...

شركة تنظيف بالجبيل

شركتنا الشركة الاولي في مجال التنظيف حيث ان شركتنا لديها افضل عماله مدربه علي اعلي جوده واعلي
وافضل المواد العالميه التي تستخدمها الشركه
حيث ان شركة تنظيف بالجبيل لديها فريق عمل مدرب علي اصعب انواع البقع الصعبه التي تواجهه كل ست بيت اثناء تنظيف المنزل
فلا داعي للقلق بعد الان شركة تنظيف بالجبيل لديها خبره تتعدي العشرون عام مما تجعلها رائده في مجال التنظيف
كما ان شركة تنظيف بالجبيل
تستخدم مواد ليس لها تاثير ضار علي صحتك او علي صحه اسرتك
حيث ان الشركة حاصله علي موافقه من وزاره الصحه
كما تقدم الشركة خدمات تنظيف السجاد والموكيت الكنب باعلي جوده وبتقنيات حديثه مثل تقنيات البخار
التي تجعل السجاد\ والكنب والموكيت والمجالس وكانها جديده
ككما تقوم الشركة بتنظيف المجالس المصنوعه من الجلد بافضل انواع الزيوت العالميه التي تجعلها نظيفه
وتضيف لها لمعان وتزيل اثار احتكاك الاجسام بها واثار تعرق جسم الانسان بها
فلا داعي للتردد شركتنا الاولي والافضل في مجال التنظيف تقدم الشركه افضل العروض وافضل الخدمات التي تناسب جميع العملاء
باقل تكاليف واعلي جوده وافضل حدمه فالشركه تتميز بالدقه والسرعه في تاديه خدمه التنظيف
كما يمكنك التعاقد مع الشركه للتتنظيف اسبوعيا او شهريا باقل التكليف ما علكي سيدتي الا الاتصال علي شركة تنظيف بالجبيل
واتركي لها زمام الامور

asmaa ahmad said...

شركة تنظيف مسابح بالرياض
المسابح شئ مهم لا يمكننا الاستغناء عنه وخصوصا في فصل الصيف التي تكون درجه الحراره به عاليه
يقضي بعض من الناس وقت كبير في المسابح لتخلص من درجه الحراره العاليه ولالحصول علي نسبه من الرطوبه
لذلك لابد من الاهتمام بتنظيف المسابح اول باول للتخلص من الشوائب والاتربه والحفاظ علي المياه
وحتي لا تكون سبب في نقل الامراض والفيروسات لذلك لابد من تنظيفها اول باول للتخلص من الشوائلب والطحالب والاوساخ التي تنتج من جسم الانسان
وايضا من اشاعه الشمس المضره فاذا لم تقومي بتنظيف المسابح اول باول فقد تكون مصدر كبير لانتقال الامراض والفيروسات من جسم الي جسم
وقد تسبب العيد مكن الامراض التي نحن في غنا عنها فلا تتردي سيدتي في التعامل نع شركة تنظيف المسابح بالرياض
حيث ان شركتنا يوجد لديها فريق عمل مدرب باعلي جوده
كما ان الشركة تقوم بتفريغ المسبح من المياه بالكامل ثم تقوم باالعمل علي تنظيفه باعلي جوده وبافضل المواد التي لا ضرر لها علي صحتك كما انها حاصله علي موافقه من وزاره الصحه كما ان لالشركة تستخدم مواد امنه لتطهير المياه كما يمكنك التعاقد مه شركتنا بشكل اسبوعي او شهري لتنظيف المسابح والحصول علي اعلي جوده
كما ان شركتنا تقدم افضل الاسعار التي تناسب جميع عملائها كما تقوم الشركة بالخدمه بافضل جوده ودقه

asmaa ahmad said...


تقدم شركه كشف تسربات المياه بالقطيف
الي عملائها افضل خدمه في مجال كشف التسربات بافضل جوده ممكنه جيث ان شركتنا الاولي في مجال كسف التسربات ولها تاريخ كبير في هذا المجال
كما ان الشركة تقوم بخدمه كشف التسربات دون الحااجه الي تكسير الحوائط او السيراميك المياه لديك ضعيفه بسبب تسربات المياه فلا داعي للانتظار
حيث ان هذه المياه توثر علي منزلك وقد تكون سبب في انهيار ذلك المنزل وزياده الرطوبه بالحوائط والجدران مما يجعلها تتلف الطلاء
وايضا تساعد علي انتشار الحشرات بشكل كبير وتساعد علي تكاثرها
وانتشارها داخل المنزل فلا داعي للانتظار لا عليكي سوء التعامل مع شركة كشف تسربات المياه بالقطيف
واتركي لها زمام الامور فالشركة تتميز بالدقه والامانه والسرعه العاليه في تاديه الخدمه كما
ان الشركه يوجد لديها فريق عمل مدرب علي ايد خبره في مجال كشف التسربات ومدرب علي افضل المعدات التي لا تحتاج الس تكسير لكشف مكان التسربات شركتنا
تسعي ان تكون الاولي دائما في مجال كشف التسربات لذلك تعمل علي تطوير الالات والاساليب التي تستخدمها اول باول للحصول علي اعلي جوده في مجال كشف التسربات
وحتي تكون لاولي والافضل دائما لا عليكي سيدتي سوء ان تتركي لها زمام الامور
ولا داعي للقلق علي منزلك مع شركة كشف تسربات المياه بالقطيف

asmaa ahmad said...

شركة مكافحه حشرات بالاحساء
انتشار الحشرات في المنزل من الاشياء الخطيره التي تودي الي الامراض والاوبئه والفيروسات وتسبب موت الكائنات التي تربيها داخل منزلك شركة مكافحه الحشرات بالاحساء
شركة متخصصه في مكافحه جميع انواع الحشرات بافضل انواع المبيدات العالميه التي ليس لها اثر سلبي علي صحتك او علي صحه اولادك
لان معظم الشركات الاخري تستخدم مواد ليس معروف لها مصدر وتكون سبب في الكثير من الامراض الي اهل منزلك
حيث ان شركتنا تجري اختبارات الجوده والسلامه للمواد التي تستخدمها قبل لاجراء اي تنفيذ عمليه حيث ان سللمه عائلتك هي امانه بين ايدينا
يجب علينا الحفاظ عليها كما ان شركة مكافحه الحشرات بالاحساء تستخدم الالات عالميه في الوصول الي ادق الاماكن التي تجعل لها الحشرات منزل لها
لذلك الات التي تستخدمها الشركه دقيقه جدا للوصول الي الثقوب والشقوق الصغيره الشركه لديها فريق عمل مدرب علي ايد خبره في مجال مكافحه الحشرات
كما ان الفريق يدرب بشكل دوري ومستمر وحيث ان الشركه هدفها الوصول الي اعلي جوده في مكافحه الحشرات بجميع انواعها
كما ان الشركه تستخدم مواد خاصه بكل نوع من انواع الحشرات لا تتطلب منك خدمه مكافحه الحشرات مغادره المنزل
حيث لا يوجد ضرر عليك او علي اهل منزلك شركة مكافحه الحشرات بالاحساء اعلي جوده ودقه في مجال مكافحه الخحشرات
حيث ان الشركه لديها خبره تتعدي العشرون عام

Freddie King said...

Thank you for taking the time and sharing this information with us. It was indeed very helpful and insightful while being straight forward and to the point.
Mcdonalds gutscheine | Startlr | SaludLimpia

Masoud Etemad said...

Thanks so much for the shout out! Good luck with the site!

سریال ایرانی
طراحی سایت
جی پی اس ورزشی
اس ام اس
سنگ مصنوعی
آموزش زبان
آموزش تافل
آموزش نقاشی
آموزش تلگرام
خرید کسپر اسکای

parthiban kumar said...

superb blog....thank u for sharing the common errors in java heap it helps me a lot
Best Java Training in chennai

dodo dody said...

شركة كشف تسربات المياه بالدمام
شركة كشف تسربات المياه بالخبر
شركة كشف تسربات المياه بالجبيل
شركة كشف تسربات المياه بالاحساء
شركة كشف تسربات المياه بالقطيف

Thu Lê said...

I was very impressed by this post, this site has always been pleasant news. Thank you very much for such an interesting post. Keep working, great job! In my free time, I like play game: mutilateadoll2game.com. What about you?

TROY INFOTECH said...

Thanks for sharing valuable information....

android training in chennai
Ios app training in chennai
java training in chennai
Seo training in chennai

JMICRO TECHNOLOGIES said...

Thank you for providing such nice and useful information.
Android training in chennai
Ios app training in chennai
Java training in chennai
Seo training in chennai