cancel
Showing results for 
Search instead for 
Did you mean: 

Java heap space exception when Building Activiti - OSGi Rest

bernd_ruecker
Champ in-the-making
Champ in-the-making
I always get an java.lang.OutOfMemoryError: Java heap space exception when building Activiti at the moment, always when it tries to build OSGi Rest. Anybody else facing the same problem?



[INFO] ————————————————————————
[INFO] Building Activiti - OSGi Rest
[INFO]    task-segment: [install]
[INFO] ————————————————————————
[INFO] [resources:resources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:compile]
[INFO] Nothing to compile - all classes are up to date
[INFO] [resources:testResources]
[INFO] Using default encoding to copy filtered resources.
[INFO] [compiler:testCompile]
[INFO] Not compiling test sources
[INFO] [surefire:test]
[INFO] Tests are skipped.
[INFO] [bundle:bundle]
java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.resize(HashMap.java:462)
        at java.util.HashMap.addEntry(HashMap.java:755)
        at java.util.HashMap.put(HashMap.java:385)
        at java.util.HashSet.add(HashSet.java:200)
        at aQute.lib.osgi.Clazz.constantUtf8(Clazz.java:423)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:132)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:102)
        at aQute.lib.osgi.Clazz.parseClassFileWithCollector(Clazz.java:91)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:80)
        at aQute.lib.osgi.Analyzer.analyzeJar(Analyzer.java:1361)
        at aQute.lib.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:1296)
        at aQute.lib.osgi.Analyzer.analyze(Analyzer.java:105)
        at aQute.lib.osgi.Builder.analyze(Builder.java:198)
        at aQute.lib.osgi.Analyzer.calcManifest(Analyzer.java:283)
        at aQute.lib.osgi.Builder.build(Builder.java:78)
        at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:393)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:284)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:238)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:229)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOfRange(Arrays.java:3209)
        at java.lang.String.<init>(String.java:215)
        at java.io.DataInputStream.readUTF(DataInputStream.java:644)
        at java.io.DataInputStream.readUTF(DataInputStream.java:547)
        at aQute.lib.osgi.Clazz.constantUtf8(Clazz.java:422)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:132)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:102)
        at aQute.lib.osgi.Clazz.parseClassFileWithCollector(Clazz.java:91)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:80)
        at aQute.lib.osgi.Analyzer.analyzeJar(Analyzer.java:1361)
        at aQute.lib.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:1296)
        at aQute.lib.osgi.Analyzer.analyze(Analyzer.java:105)
        at aQute.lib.osgi.Builder.analyze(Builder.java:198)
        at aQute.lib.osgi.Analyzer.calcManifest(Analyzer.java:283)
        at aQute.lib.osgi.Builder.build(Builder.java:78)
        at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:393)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:284)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:238)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:229)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.addEntry(HashMap.java:753)
        at java.util.HashMap.put(HashMap.java:385)
        at java.util.HashSet.add(HashSet.java:200)
        at aQute.lib.osgi.Clazz.constantClass(Clazz.java:385)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:157)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:102)
        at aQute.lib.osgi.Clazz.parseClassFileWithCollector(Clazz.java:91)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:80)
        at aQute.lib.osgi.Analyzer.analyzeJar(Analyzer.java:1361)
        at aQute.lib.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:1296)
        at aQute.lib.osgi.Analyzer.analyze(Analyzer.java:105)
        at aQute.lib.osgi.Builder.analyze(Builder.java:198)
        at aQute.lib.osgi.Analyzer.calcManifest(Analyzer.java:283)
        at aQute.lib.osgi.Builder.build(Builder.java:78)
        at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:393)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:284)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:238)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:229)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.OutOfMemoryError: Java heap space
        at java.util.HashMap.addEntry(HashMap.java:753)
        at java.util.HashMap.put(HashMap.java:385)
        at java.util.HashSet.add(HashSet.java:200)
        at aQute.lib.osgi.Clazz.constantUtf8(Clazz.java:423)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:132)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:102)
        at aQute.lib.osgi.Clazz.parseClassFileWithCollector(Clazz.java:91)
        at aQute.lib.osgi.Clazz.parseClassFile(Clazz.java:80)
        at aQute.lib.osgi.Analyzer.analyzeJar(Analyzer.java:1361)
        at aQute.lib.osgi.Analyzer.analyzeBundleClasspath(Analyzer.java:1296)
        at aQute.lib.osgi.Analyzer.analyze(Analyzer.java:105)
        at aQute.lib.osgi.Builder.analyze(Builder.java:198)
        at aQute.lib.osgi.Analyzer.calcManifest(Analyzer.java:283)
        at aQute.lib.osgi.Builder.build(Builder.java:78)
        at org.apache.felix.bundleplugin.BundlePlugin.buildOSGiBundle(BundlePlugin.java:393)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:284)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:238)
        at org.apache.felix.bundleplugin.BundlePlugin.execute(BundlePlugin.java:229)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
[INFO] ————————————————————————
[ERROR] FATAL ERROR
[INFO] ————————————————————————
[INFO] Java heap space
[INFO] ————————————————————————
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
[INFO] ————————————————————————
6 REPLIES 6

jbarrez
Star Contributor
Star Contributor
Have you set MAVEN_OPTS to have more memory, you know the -Xms and -Xmx stuff ?

bernd_ruecker
Champ in-the-making
Champ in-the-making
I try that when I have more time. For the moment I can work without OSGI. The problem with the not working distro on windows is a bigger one 😉

nils1
Champ in-the-making
Champ in-the-making
Commenting out the avtiviti-osgi-rest module in the root pom does the trick for me.

Cheers,
Nils

bernd_ruecker
Champ in-the-making
Champ in-the-making
That's what I meant with "I can work without OSGI". I did exactly the same 🙂

jbarrez
Star Contributor
Star Contributor
Nils: Commenting out the avtiviti-osgi-rest module in the root pom does the trick for me.
Bernd: "I can work without OSGI"

And there you have the difference between a developer and a manager 😉

gnodet
Champ in-the-making
Champ in-the-making
I have the following line in my ~/.bash_profile:
    export MAVEN_OPTS="-Xmx1024m -Xms512m"
I suppose there is an equivalent on windows.