Forums Register Login

How to increase the Java heap memory for Maven 3 on windows7

+Pie Number of slices to send: Send
Hi friends
How to increase the Java heap memory for Maven 3 on windows7?I'm getting this error while building maven project:"java.lang.OutOfMemoryError: PermGen space”
thanks
+Pie Number of slices to send: Send
 

emma smith wrote:How to increase the Java heap memory for Maven 3 on windows7?I'm getting this error while building maven project:"java.lang.OutOfMemoryError: PermGen space”


For Maven? Dunno. It's a parameter to the java command normally.

However, before you start increasing heap space, you might want to ask yourself why. The defaults are usually more than adequate for a normal program, so if you're exceeding it, it might indicate a problem with your code.

Winston
+Pie Number of slices to send: Send
 

Winston Gutkowski wrote:For Maven? Dunno. It's a parameter to the java command normally.

However, before you start increasing heap space, you might want to ask yourself why. The defaults are usually more than adequate for a normal program, so if you're exceeding it, it might indicate a problem with your code.

Winston


yes, for maven i'm sure that the code is correct because i want to run apache stanbol launcher, it isn't my code!
+Pie Number of slices to send: Send
 

Winston Gutkowski wrote:However, before you start increasing heap space, you might want to ask yourself why. The defaults are usually more than adequate for a normal program, so if you're exceeding it, it might indicate a problem with your code.


Maven is well-known for needing oodles of memory, especially for large projects. It's a build-time tool, so what the code actually does makes little difference - there are probably lots of classes, or other build-time complications.

Maven JVM options can be set via the MAVEN_OPTS environment variable. On a Unix-ish system it would be something like "setenv MAVEN_OPTS -Xmx1024m -XX:MaxPermSize=128m".
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:Maven is well-known for needing oodles of memory, especially for large projects. It's a build-time tool, so what the code actually does makes little difference - there are probably lots of classes, or other build-time complications.


Oops. My apologies then Emma: listen to Ulf; he knoweth of which he speak.

Winston
+Pie Number of slices to send: Send
 

Ulf Dittmer wrote:
Maven JVM options can be set via the MAVEN_OPTS environment variable. On a Unix-ish system it would be something like "setenv MAVEN_OPTS -Xmx1024m -XX:MaxPermSize=128m".


Ok Ulf, i have done it but yet i'm getting java.long.outOfMemeryError!
do you have any more suggestion? don't you think i change the version of maven?
+Pie Number of slices to send: Send
On Windows the command should be:

set MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

Did you try that?
+Pie Number of slices to send: Send
 

emma smith wrote:
yes, for maven i'm sure that the code is correct because i want to run apache stanbol launcher, it isn't my code!


Why it wastes that much RAM, do you run Apache Stanbol launcher within Maven hosted JVM? In this case you better to fork another process with JVM for Stanbol.
+Pie Number of slices to send: Send
 

Jesper de Jong wrote:On Windows the command should be:

set MAVEN_OPTS="-Xmx1024m -XX:MaxPermSize=128m"

Did you try that?


yes i tried it with 128,512,1024...
+Pie Number of slices to send: Send
 

surlac surlacovich wrote:
Why it wastes that much RAM, do you run Apache Stanbol launcher within Maven hosted JVM? In this case you better to fork another process with JVM for Stanbol.


can you explain more Surlac? exactly what should i do?
+Pie Number of slices to send: Send
 

emma smith wrote:can you explain more Surlac? exactly what should i do?


Try to use forkMode (or forkCount).
+Pie Number of slices to send: Send
Any success with that, emma smith?
+Pie Number of slices to send: Send
 

surlac surlacovich wrote:Any success with that, emma smith?


No Surlac i did evrything but i didn't succeed
+Pie Number of slices to send: Send
Do you use latest stable version of Maven?
+Pie Number of slices to send: Send
 

surlac surlacovich wrote:Do you use latest stable version of Maven?


yes,i'm really tired!!!
+Pie Number of slices to send: Send
Connect with profiler and see when the memory consumption grows, dump memory to a file (jmap -permstat <pid>), see which objects wastes permgen space.
Get me the mayor's office! I need to tell her about this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 44634 times.
Similar Threads
Java heap space exception(outofmemoryexception)
How to read memory usage for process running in Linux,
Help Locate Cause of Application Slowdown
How do I increase heap size when doing release perform in Maven
Exception in reading PDF using java
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:23:18.