OutofMemory Error while building package

50 views
Skip to first unread message

Ramnath Medikonda

unread,
Jan 25, 2016, 4:45:10 PM1/25/16
to CDAP User
Hello Team,

We are getting the below error when we were trying to create package for a Sink. This package has a few custom written java files and one S3TextBatchSink class that extends the S3BatchSink class.

We were not getting this error when we did the same process a month ago.

Any idea where it might be causing this problem?

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.344 s
[INFO] Finished at: 2016-01-25T21:35:51+00:00
[INFO] Final Memory: 48M/371M
[INFO] ------------------------------------------------------------------------
[ERROR] Java heap space -> [Help 1]
java.lang.OutOfMemoryError: Java heap space
at java.util.Arrays.copyOf(Arrays.java:2271)
at java.io.ByteArrayOutputStream.grow(ByteArrayOutputStream.java:113)
at java.io.ByteArrayOutputStream.ensureCapacity(ByteArrayOutputStream.java:93)
at java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:140)
at aQute.lib.osgi.EmbeddedResource.copy(EmbeddedResource.java:62)
at aQute.lib.osgi.EmbeddedResource.collect(EmbeddedResource.java:51)
at aQute.lib.osgi.EmbeddedResource.build(EmbeddedResource.java:33)
at aQute.lib.osgi.EmbeddedResource.build(EmbeddedResource.java:71)
at aQute.lib.osgi.Verifier.getBundleClassPath(Verifier.java:255)
at aQute.lib.osgi.Verifier.<init>(Verifier.java:204)
at aQute.lib.osgi.Builder.doVerify(Builder.java:434)
at aQute.lib.osgi.Builder.build(Builder.java:104)
at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:547)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:347)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:264)
at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:255)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:862)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:286)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:197)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:

Terence Yim

unread,
Jan 25, 2016, 4:47:12 PM1/25/16
to Ramnath Medikonda, CDAP User
Hi,

Maven by default only allocate 256M of memory. If your project uses several dependencies, then there is a chance that Maven runs out of memory when trying to build the bundle jar. You can increate the memory size by:

export MAVEN_OPTS=“-Xmx1024m”
mvn clean package

Terence


--
You received this message because you are subscribed to the Google Groups "CDAP User" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cdap-user+...@googlegroups.com.
To post to this group, send email to cdap...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cdap-user/ef12af87-f2aa-4ea6-8a27-889668e6f702%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ramnath Medikonda

unread,
Jan 25, 2016, 5:16:52 PM1/25/16
to CDAP User, medikond...@gmail.com
Hello Terence,

Increasing the memory size did not help.


Thanks,
Ramnath M

Terence Yim

unread,
Jan 25, 2016, 5:18:40 PM1/25/16
to Ramnath Medikonda, CDAP User
Hi,

Would you mind sharing your pom.xml file? Or at least just the <dependencies> section and the bundle jar plugin section.

Terence

Ramnath Medikonda

unread,
Jan 25, 2016, 5:30:21 PM1/25/16
to CDAP User, medikond...@gmail.com
Hello Terence,

Please find it attached.

Thanks,
Ramnath M
pom.xml

Terence Yim

unread,
Jan 25, 2016, 5:47:28 PM1/25/16
to Ramnath Medikonda, CDAP User
Hi Ramnath,

Please try to mark the dependencies hadoop-mapreduce-client-core and hadoop-core in provided scope instead. They are provided by the platform and doesn’t need to be in the plugin jar.

<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-mapreduce-client-core</artifactId>
<version>2.7.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.hadoop</groupId>
<artifactId>hadoop-core</artifactId>
<version>1.2.1</version>
<scope>provided</scope>
</dependency>

Terence

> On Jan 25, 2016, at 2:30 PM, Ramnath Medikonda <medikond...@gmail.com> wrote:
>
> <pom.xml>

Ramnath Medikonda

unread,
Jan 26, 2016, 12:58:16 PM1/26/16
to CDAP User, medikond...@gmail.com
Than you Terence! It worked.


Thanks,
Ramnath M
Reply all
Reply to author
Forward
0 new messages