java.lang.OutOfMemoryError: Java heap space while generating reports - ant

I am trying to generate HTML reports from txt format reports that were generated after executing junit test cases. On running ant command with build.xml in proper location, I am getting below error message
java.lang.OutOfMemoryError: Java heap space
I tried increasing heap space by ANT_OPTS=-Xmx1024m command.
Still facing the same issue.

Use export JAVA_OPTS=-Xmx1024m before starting Ant, because ANT_OPTS may be overriden by JAVA_OPTS if they are set system wise

Related

Increase apache ant permgen space in Windows 7

How to increase permgen space in apache 1.9.2
I looked for a solution and couldn't find. I'm calling "ANT" command from the build directory. I tried changing the antenv.cmd as well.
Use the environmentvariable ANT_OPTS , as described in ant manual
(see Environment Variables section) to set JVM parameters like f.e.:
-XX:PermSize -XX:MaxPermSize ... etc.
How about adding
set ANT_OPTS = <values>
in /bin/ant.cmd

getting outofmemory error in grails run-app

I am trying to execute grails run-app and getting out of memory error.
[groovyc] java.lang.OutOfMemoryError: Java heap space
I have set grails_opts as: GRAILS_OPTS="-XX:MaxPermSize=2048m -Xmx4096M -server"
Tried various options for JAVA_OPTS also but still getting outofmemory error.

Setting Heap size and other JVM parameters in Grails 2.2.4

I recently encountered the following error running a Grails application that will utilmately be a quartz job triggered by a cron (currently attached to a controller for development):
2014-11-21 12:37:34,538 [quartzScheduler_Worker-1] ERROR listeners.ExceptionPrinterJobListener - Exception occurred in job: Grails Job
Message: java.lang.OutOfMemoryError: GC overhead limit exceeded
I want to increase the Heap speace but I'm not sure of the correct way to do it for my grails version(2.2.4).
Do I create a GRAILS_OPT environment variable or do I use grails.project.fork?
I will assume that you are needing to change these settings for development and doing so is accomplished using GRAILS_OPT environment variable. Consult instructions for your OS on how to do so.
From the Grails documentation:
It's often useful to provide custom arguments to the JVM when running
Grails commands, in particular with run-app where you may for example
want to set a higher maximum heap size. The Grails command will use
any JVM options provided in the general JAVA_OPTS environment
variable, but you can also specify a Grails-specific environment
variable too:
export GRAILS_OPTS="-Xmx1G -Xms256m -XX:MaxPermSize=256m"
grails run-app

Eclipse Memory Analyzer: Unable to attach to 32-bit process

when trying to acquire a Heapdump of my eclispe rcp application with the Java Memory Analayzer I get the following error message:
Error creating heap dump. jmap exit code = 1
4120: Unable to attach to 32-bit process running under WOW64
The -F option can be used when the target process is not responding
OS: 64bit Windows7
Java Memory Analyzer: 64bit
Application: 32bit
I tried the 32 and the 64 bit variation and got the same error.
Cans oemone tell me what the problem is?
This means that the jmap you are using is the one that is bundled with the 64 bit version of the JDK. If you are using this jmap to acquire a heap dump from a 32 bit JVM, then this error pops up.
Solution : Use the version of jmap that is bundled with the 32 bit JDK.
Let's say you have Java 64 bit version(so is for Java tools like jvisualvm and jstack) and the IDE/path, where ever you run javac command have java 32 bit in class path, then you will see such issues.
if you try to analyze this process from
1)java VisualVM, then it may not load your process properly, means you will not able to take thread/heap dumps for problematic process.
2) from jstack , then also it will create same problem like you mentioned above.
To solve the issue,make sure that everything is matched in the version.

Error in running RMIC via Ant using wsejbdeploy taskdef

I get the following exception when trying to generate RMIC using Ant task.
[wsejbdeploy] Error generating RMI code: RMIC command failed on project: .... with message:
[wsejbdeploy] error: The IBM RMIC version 0x1500 does not match the IBM runtime version 0x1600.
Please let me know how to fix this.
I am trying this using the WebSphere 6.1 server that comes bundled with RAD7.5.
This works fine when we use IDE to generate the EAR, and fails only when we use our custom Ant build file.
The error means that JAVA_HOME in your shell used to invoke Ant is different from the Java that was included with the embedded WebSphere Application Server. Try using the WAS_HOME/bin/ws_ant script, or set JAVA_HOME to WAS_HOME/java/.
The error
Cannot run RMIC because it is not installed. Expected location of RMIC is the following:
will some times confuse. enable the "Capture RMIC verbose output to the workspace .log file.
and see what the exact error your getting. This option will be available in properties > EJBDeployment.
In My case it throwing error due to huge number of jars in class path.It got resolved after shortening the class path jar location.

Resources