Scanning Error during Import of Maven Projects into Eclipse - eclipse

I have looked up the following error in numerous places but can't seem to get a consensus on the solution or one that works for that matter.
"Maven Projects
Scanning error[path to project]; java.lang.OutOfMemoryError: Java heap space"
I set MAVEN_OPTS to "-Xms512m -Xmx1024m -XX:MaxPermSize=1024"
The project I am importing is an assets project with many images, icons, .swf, and JS files.
Is there something else I need or am I setting the above in the terminal the wrong way?

Look at the maven build process in jvisualvm (from your jdk). There you can see how much memory is consumed. If you see that the build exceeds the 1024 MB, set -Xmx to a higher value. If you see that the maximal heap size is below 1024 MB, then your MAVEN_OPTS settings did not work.

Increase more heap size more again, Setting for JVM: http://www.wikihow.com/Increase-Java-Memory-in-Windows-7
Open Java mission control to see RAM, heap size usage. It will give you insight to good decision how much memory size is suitable.
http://www.oracle.com/technetwork/java/javaseproducts/mission-control/java-mission-control-1998576.html

Related

GWT 2.5.1 Compile always throws Java Heap Space Error

Whenever I compile GWT 2.5.1 application. by right click on project and doing Run As-> Web Application (GWT Super Dev Mode), it never fully compiles and throws Java heaps space full error. Even when I increase the heap space size to as max as it can be, it is still throwing the same error. No matter what memory value I give, it always failes with heap space error. Can anyone help out?
How did you increase the heap space? In IntelliJ for example you need to explicitely give the build process more space:
Settings > Build, Execution, Deployment > Compiler > Build process heap size

Reducing disk-space consumption of Eclipse

I am trying to free some disk space. I found out that files related to Eclipse take up a lot of space. I would like to know which of them I can remove without harming the operation of Eclipse. In particular:
The folder ~/.p2 takes 1 GB. Most weight is in .p2/pools/plugins. Is it the real code of the plugins or only a cache that can be deleted?
The eclipse-installer takes about 60 MB. Do I need it after instasllation or can I delete it?
Are there any other cached files that can be deleted?
(I have Eclipse Oxygen on Ubuntu 16.04, if that matters).
You can safely delete the eclipse-installer. It's components are embedded into your installation and therefore there is no dependency on it anymore.
As for ~/.p2, this is the main code of your Eclipse installation. The good thing about it is that multiple instances installed via the eclipse-installer share the P2 pool.
The bad thing about it is that it does not clean up any unnecessary bundles after updates automatically, so there might be old and unused versions of bundles in that folder. You can use the Cleanup Agent of the Eclipse Installer to clean up the bundle pool (kudos to howlger for the cleanup hint!)
If you are doing Eclipse development (PDE), the .metadata\.plugins\org.eclipse.pde.core folder might be one of the most effective places to free disk space, because launch configurations and target platforms store their configuration and caches there. But this only makes sense if you do not plan to use Eclipse for a while...

gradle project import failure

I am trying to import an gradle project into my eclipse but facing some error,
I am adding the screenshot below
please help me sort out the problem
It seems it cannot allocate enough memory to start the daemon process. Can you try increasing the heap size of the JVM?
This webpage shows you how to increase Eclipse's heap size:
http://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F

IntelliJ increase Scalatest Heap space

I'm using IntelliJ to run Scalatest tests. Problem I'm having is the tests are running out of Heap space (likely because my tests are using Selenium and starting up jettys to hit my Api).
I know how to increase my Heap space in IntelliJ but after increasing the space the tests still run out of Heap.
Is there a different place to increase Heap space for tests rather than the usual IntelliJ info.plist (oh btw I'm on Mac)
go to Edit Configurations:
Choose the test on the left, and tweak its VM options:
In case you are using a ScalaTest ant task, there is a jvmarg that you can set:
<jvmarg value="-Xmx2048m -XX:MaxPermSize=128m"/>
As you rightly observed, it is not IDEA's heap size that needs to be increased but rather that of the ScalaTest run configuration accessible from the Run > Edit Configurations... dialog. There, you should be able to set the VM Options for the tests you are trying to run.

Specify memory for ant maven deploy task

I am using ant maven deploy task to upload the zip file created by the ant script to our repository, but the problem is the file is too big and it fails with
java.lang.OutOfMemoryError: Java heap space. Following is the task
<deploy uniqueversion="false">
<remoterepository url="${repository}" id="${repositoryId}"/>
<remotesnapshotrepository url="${snapshotRepository}" id="${snapshotRepositoryId}"/>
<attach file="target/${qname}-dist.zip" type="zip"/>
<pom file="pom.xml" groupid="com.my.company" artifactid="test" packaging="zip" version="${version}" />
</deploy>
How do I specify memory heap size here, I don't seem to find anything in deploy task or some of its children task.
Maven doesn't fork on the deploy task so to increase the memory, you have to increase the heap size for the maven executable itself. You can just set your MAVEN_OPTS environment variable to include the -Xmx setting: MAVEN_OPTS=”-Xmx512m”