2

Was trying to install a module using maven in IntelliJ IDEA. It threw the following error on doing so

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] There are test failures.

My questions are:

  1. Is this due to the VM size settings in idea/bin/vmoptions file? Will increasing it make any difference?
  2. If so, how do I do it? Since I don't have the necessary privileges to edit the file, is there an other option to change it from IntelliJ rather than editing the file?
  3. If not possible will it be really worth requesting for admin priv for changing it?

Edit: Current vmoptions file contents (using Intellij IDEA 8.1.4 )

-Xms32m
-Xmx256m
-XX:MaxPermSize=150m
-ea
Kara
  • 6,115
  • 16
  • 50
  • 57
Chillax
  • 4,418
  • 21
  • 56
  • 91
  • 1
    Could we see your `vmoptions`? Most likely you've made a type in the `-Xmx=...` option. Have a look at this article: http://javahowto.blogspot.dk/2006/06/6-common-errors-in-setting-java-heap.html – Anders R. Bystrup Nov 04 '12 at 15:45
  • @AndersRostgaardBystrup haven't made any changes in vmoptions. Its the default for Intelli IDEA 8.1.4. Have edited my question to include that. – Chillax Nov 04 '12 at 17:02
  • You can't update to the newest version of IntelliJ? Or at least request it? – Makoto Nov 04 '12 at 17:07
  • @Makoto nopes :-( . Have the License only for this version. And have been asked to use this version only. – Chillax Nov 04 '12 at 17:09
  • That seems...dumb. The *free* edition is already up to version 11.1.4, and if someone's paying cash for your development, then they should be prepared to pony up for the best software money can buy. (Take it from someone that's been using it professionally - it's well worth it.) – Makoto Nov 04 '12 at 17:14
  • @Makoto but is the free edition enough? guess it would be better than the licensed 8.1.4 version? I have been using eclipse all along and therefore don't know anything abt intellij. Maybe I can put up a case with my Manager. Any suggestions for the problem? – Chillax Nov 04 '12 at 17:23
  • 3
    Did you check the FAQ: http://devnet.jetbrains.net/docs/DOC-1185 ? – CrazyCoder Nov 04 '12 at 22:22

2 Answers2

10

There are two sides to this.

  • If you're using a 32-bit JVM and have 4GB or more memory, then you may be running into an issue with non-contiguous Java memory. The solution there would be to switch over to a 64-bit JVM.

  • If you're using a 64-bit JVM already, then increase the amount of memory you use when running your application. Here are some numbers:

    -Xms128m
    -Xmx512m
    -XX:MaxPermSize=300m
    -ea
    
Community
  • 1
  • 1
Makoto
  • 104,088
  • 27
  • 192
  • 230
  • Since my OS is 32 bit, I guess the Java installed is 32 bit too?. So won't increasing the setting as given above solve my prob if its 32 bit? Sorry i cannot try now since I have to get admin priv for that. And one last thing, will having the latest IntelliJ version solve my prob? – Chillax Nov 04 '12 at 17:41
  • Probably not your problem directly; this issue likely has nothing to do with the IDE itself. It's just unusual to hear of someone using a *much* older version of a very good IDE. – Makoto Nov 04 '12 at 17:46
3

There are two files in the Intellij installation directory idea.exe.vmoptions and idea64.exe.vmoptions. I was changing the wrong file for a while to increase the memory and could not get it to work. Open the appropriate file and increase the memory as mentioned in the previous answer to solve this problem.

An Illusion
  • 769
  • 1
  • 10
  • 24