1

i have sent heap size to -Xmx512m -XX:MaxPermSize=14336m but still i'm getting out of memory error. could you please help me in explaining that how much heapmemory can we set in windows8 machine(Ram size 16GB)

3 Answers3

1

As discussed in This question here, the MaxPermSize argument is the

maximum size for the permanent generation heap, a heap that holds the byte code of classes and is kept separated from the object heap containing the actual instances

While the flag Xmx is responsible for the memory where instances are created. Now I don't understand your application but I personally do not believe you need ~14GB of byte-code cached in it. Try potentially changing your Max heap Size (Xmx) rather than perm size and see how that turns out, seeing as the most likely cause is that you are creating too many instances for the memory you have allocated.

Community
  • 1
  • 1
T-Fowl
  • 704
  • 4
  • 9
  • Actually i'm trying to analyse my application with help of sonar runner, so in sonar site they mentioned that if we get out of memory error, increase the follwoing size"-Xmx512m -XX:MaxPermSize=14336m " – user4265348 Nov 18 '14 at 12:28
  • thanks,as you said,i'll increase my max heap size instead of perm size and i'll try to execute it – user4265348 Nov 19 '14 at 06:53
0

As much as your physical ram + virtual memory. See my virtual memory below. Do not forget that all of this memory is shared among your processes, therefore you should close all unnecessary applications when your memory hungry processes work.

To see your virtual memory information. System -> Advanced System Settings -> Advanced Tab See following Microsoft help for more information. Change the size of virtual memory

virtual memory.

Atilla Ozgur
  • 14,339
  • 3
  • 49
  • 69
0

You seem to misunderstand what heap and what permgen space really does: Perm space vs Heap space

You need to increase heap size: e.g. -Xmx1g. MaxPermSize should be limited to maybe 300m. The value you used like 14G is simply too high and IMHO of no practical use.

Watch out for your Java VM. 32Bit JavaVM can only address around 1.2G (sum of heap and perm gen) while 64Bit Java could address larger heaps like e.g. 8g.

If you are looking at sonars documentation: http://docs.codehaus.org/display/SONAR/Analyzing+with+SonarQube+Runner you see, they mention 128m perm size.

Community
  • 1
  • 1
wumpz
  • 8,257
  • 3
  • 30
  • 25