You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Ryan Moquin <fr...@gmail.com> on 2009/06/08 17:56:32 UTC

Question about Maven2 and Heap Space

I'm trying to figure out why maven 2.1 is running out of heap space when I
do a release:perform on my project.  The project builds fine until I do a
release:perform in which case it runs out of memory.  The stack trace seems
to indicate that there was enough memory.  Do I need to give more memory to
the release plugin?  Here is the stacktrace, it seems like there is a
spawned JVM at the time of the error which doesn't have enough memory:

[INFO] 262144/351338K
[INFO] 262148/351338K
[INFO] [INFO]
------------------------------------------------------------------------
[INFO] [ERROR] FATAL ERROR
[INFO] [INFO]
------------------------------------------------------------------------
[INFO] [INFO] Java heap space
[INFO] [INFO]
------------------------------------------------------------------------
[INFO] [INFO] Trace
[INFO] java.lang.OutOfMemoryError: Java heap space
[INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
[INFO]  at
java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
[INFO]  at
sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
[INFO]  at
org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
[INFO]  at
org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
[INFO]  at
org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
[INFO]  at
org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
[INFO]  at
org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
[INFO]  at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
[INFO]  at
org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
[INFO]  at
org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
[INFO]  at
org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
[INFO]  at
org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
[INFO]  at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
[INFO]  at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
[INFO]  at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
[INFO]  at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
[INFO]  at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
)
[INFO]  at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
[INFO]  at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
[INFO]  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
[INFO]  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
[INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
[INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[INFO]  at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
[INFO]  at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
[INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
[INFO]  at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
[INFO]  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
[INFO]  at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
[INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO] [INFO]
------------------------------------------------------------------------
[INFO] [INFO] Total time: 30 minutes 19 seconds
[INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
[INFO] [INFO] Final Memory: 473M/1016M
[INFO] [INFO]
------------------------------------------------------------------------
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Maven execution failed, exit code: '1'

[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 33 minutes 32 seconds
[INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
[INFO] Final Memory: 36M/65M
[INFO]
------------------------------------------------------------------------

Thanks,
Ryan

Re: Question about Maven2 and Heap Space

Posted by Baptiste MATHUS <ml...@batmat.net>.
Well, after some research, it seems like this is due to the fact that
PosterOutputStream/ByteArrayOutputStream class is quite space-greedy,
according to:
https://issues.alfresco.com/jira/browse/ETHREEOH-974

Looking at the code shows that PosterOutputStream can't be the culprit, as
it's not doing a lot of things apart maintaining an additional "closed"
boolean:
http://www.docjar.org/html/api/sun/net/www/http/PosterOutputStream.java.html

But I don't completely understand what version of ByteArrayOutputStream was
used. More precisely, I don't find the
"java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)" method,
even in the hierarchy.
What version of Java are you running?

Anyway, I guess you could file an issue. But please run mvn deploy so that
you can file the issue into deploy-plugin (or even the right wagon impl)
instead of release-plugin jira if more apropriate.

Cheers

2009/6/8 Baptiste MATHUS <ml...@batmat.net>

> Interesting. The artifact you're trying to deploy is 350MB+ large.
> Could you please try and just "mvn deploy" your project?
>
> I don't remember if the release plugin forks or not.
>
> My 2 cents,
> Cheers
>
> 2009/6/8 Ryan Moquin <fr...@gmail.com>
>
> I'm trying to figure out why maven 2.1 is running out of heap space when I
>> do a release:perform on my project.  The project builds fine until I do a
>> release:perform in which case it runs out of memory.  The stack trace
>> seems
>> to indicate that there was enough memory.  Do I need to give more memory
>> to
>> the release plugin?  Here is the stacktrace, it seems like there is a
>> spawned JVM at the time of the error which doesn't have enough memory:
>>
>> [INFO] 262144/351338K
>> [INFO] 262148/351338K
>> [INFO] [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [ERROR] FATAL ERROR
>> [INFO] [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [INFO] Java heap space
>> [INFO] [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [INFO] Trace
>> [INFO] java.lang.OutOfMemoryError: Java heap space
>> [INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
>> [INFO]  at
>> java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
>> [INFO]  at
>> sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
>> [INFO]  at
>> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
>> [INFO]  at
>> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
>> [INFO]  at
>> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
>> [INFO]  at
>> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
>> [INFO]  at
>> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
>> [INFO]  at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
>> [INFO]  at
>>
>> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
>> [INFO]  at
>>
>> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
>> [INFO]  at
>>
>> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
>> [INFO]  at
>> org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
>> [INFO]  at
>>
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>> [INFO]  at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>> [INFO]  at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>> [INFO]  at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>> [INFO]  at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
>> )
>> [INFO]  at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>> [INFO]  at
>>
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>> [INFO]  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>> [INFO]  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>> [INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>> [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> [INFO]  at
>>
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> [INFO]  at
>>
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> [INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
>> [INFO]  at
>> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> [INFO]  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> [INFO]  at
>> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> [INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> [INFO] [INFO]
>> ------------------------------------------------------------------------
>> [INFO] [INFO] Total time: 30 minutes 19 seconds
>> [INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
>> [INFO] [INFO] Final Memory: 473M/1016M
>> [INFO] [INFO]
>> ------------------------------------------------------------------------
>> [INFO]
>> ------------------------------------------------------------------------
>> [ERROR] BUILD ERROR
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Maven execution failed, exit code: '1'
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] For more information, run Maven with the -e switch
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Total time: 33 minutes 32 seconds
>> [INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
>> [INFO] Final Memory: 36M/65M
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> Thanks,
>> Ryan
>>
>

Re: Question about Maven2 and Heap Space

Posted by Ryan Moquin <fr...@gmail.com>.
Cool, thanks... I just want to make sure there wasn't another part I would
end up missing.  If that's all I need to do to finish it, then I can deal
with it. :)

I notice that when I do a deploy on the subproject, rather than the whole
thing, it uses about 950 MB of memory.. so it just barely makes it.

Ryan

On Tue, Jun 9, 2009 at 2:09 AM, Baptiste MATHUS <ml...@batmat.net> wrote:

> Sure, I already did that a couple of times. The more important and complex
> part actually resides in the release:prepare goal.
>
> Release:perform is basically just a svn checkout from the freshly created
> tag (during the prepare) followed by a mvn deploy run from the checkouted
> directory.
>
> Cheers.
>
> 2009/6/8 Ryan Moquin <fr...@gmail.com>
>
> > Ok, if I do just a mvn:deploy with 1024MB of memory, it fails at the same
> > spot with what I think is the same stack trace:
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] FATAL ERROR
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Java heap space
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Trace
> > java.lang.OutOfMemoryError: Java heap space
> >         at java.util.Arrays.copyOf(Arrays.java:2786)
> >         at
> > java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
> >         at
> > sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
> >         at
> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
> >         at
> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
> >         at
> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
> >         at
> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
> >         at
> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
> >         at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
> >         at
> >
> >
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
> >         at
> >
> >
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
> >         at
> >
> >
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
> >         at
> > org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
> >         at
> >
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> >         at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> >         at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
> >         at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
> >         at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
> > )
> >         at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> >         at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> >         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> >         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> >         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
> >         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)
> >         at
> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> >         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> >         at
> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> >         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 28 minutes 3 seconds
> > [INFO] Finished at: Mon Jun 08 16:10:21 EDT 2009
> > [INFO] Final Memory: 459M/992M
> > [INFO]
> > ------------------------------------------------------------------------
> >
> > If I use 1284 with either goal (release:perform or deploy), my project
> > fails
> > a lot sooner with an OOME at growableArray.cpp (at that point the heap is
> > only at 500MB) .. which makes no sense since with deploy only one JVM is
> > running at 1284 and fails, but with release:perform using 1024, there are
> > two JVMs running with 1024MB of memory.. so something has to be wrong
> with
> > the JVM with that much memory.
> >
> > Once again, once the checkout is done in target, can I just do a mvn
> deploy
> > on the individuals modules to effectively finish the release:perform?
>  It's
> > the only way I'm going to be able to finish my release.
> >
> > Thanks,
> > Ryan
> >
> > On Mon, Jun 8, 2009 at 11:51 AM, Ryan Moquin <fr...@gmail.com>
> > wrote:
> >
> > > It looks like it does fork since if I use jconsole, I will get a second
> > JVM
> > > that has identical properties as the first.  Part of the issue with
> this
> > is
> > > I notice that both JVMs will have the amount of memory I specify for
> > > MAVEN_OPTS.  In the above case, 1GB.  If I run release:perform, the
> > forked
> > > JVM is maxed at 1 GB of memory when the error occurs.
> > >
> > > I did try to run the JVM with 1284 MB for the maven instance (which is
> > the
> > > highest I can run it where the JVM will start), but in that case, my
> > build
> > > dies sooner because it can't allocate enough memory for the forked
> > > instance.  The initial instance of Maven2 only uses 40K of memory, so
> > it's
> > > unnecessary for it to have as much memory as the spawned process.  The
> > > server I'm building on, has 4GB of physical memory, but apparently
> enough
> > > isn't available to have the initial Maven2 instance and the spawned one
> > both
> > > running at 1284MB of memory.
> > >
> > > Other than checking out the tag, is the only other thing that the
> > > release:perform does is a "deploy"?
> > >
> > > Ryan
> > >
> > >
> > > On Mon, Jun 8, 2009 at 10:35 AM, Baptiste MATHUS <ml...@batmat.net>
> wrote:
> > >
> > >> Interesting. The artifact you're trying to deploy is 350MB+ large.
> > >> Could you please try and just "mvn deploy" your project?
> > >>
> > >> I don't remember is the release plugin forks or not.
> > >>
> > >> My 2 cents,
> > >> Cheers
> > >>
> > >> 2009/6/8 Ryan Moquin <fr...@gmail.com>
> > >>
> > >> > I'm trying to figure out why maven 2.1 is running out of heap space
> > when
> > >> I
> > >> > do a release:perform on my project.  The project builds fine until I
> > do
> > >> a
> > >> > release:perform in which case it runs out of memory.  The stack
> trace
> > >> seems
> > >> > to indicate that there was enough memory.  Do I need to give more
> > memory
> > >> to
> > >> > the release plugin?  Here is the stacktrace, it seems like there is
> a
> > >> > spawned JVM at the time of the error which doesn't have enough
> memory:
> > >> >
> > >> > [INFO] 262144/351338K
> > >> > [INFO] 262148/351338K
> > >> > [INFO] [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] [ERROR] FATAL ERROR
> > >> > [INFO] [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] [INFO] Java heap space
> > >> > [INFO] [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] [INFO] Trace
> > >> > [INFO] java.lang.OutOfMemoryError: Java heap space
> > >> > [INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
> > >> > [INFO]  at
> > >> > java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
> > >> > [INFO]  at
> > >> >
> sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
> > >> > [INFO]  at
> > >> >
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
> > >> > [INFO]  at
> > >> >
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
> > >> > [INFO]  at
> > >> >
> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
> > >> > [INFO]  at
> > >> >
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
> > >> > [INFO]  at
> > >> >
> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
> > >> > [INFO]  at
> > org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
> > >> > [INFO]  at
> > >> >
> org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
> > >> > )
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> > >> > [INFO]  at
> > >> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> > >> > [INFO]  at
> > org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> > >> > [INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
> > >> > [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native
> Method)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > >> > [INFO]  at
> > >> >
> > >> >
> > >>
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > >> > [INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
> > >> > [INFO]  at
> > >> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> > >> > [INFO]  at
> org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > >> > [INFO]  at
> > >> >
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> > >> > [INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > >> > [INFO] [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] [INFO] Total time: 30 minutes 19 seconds
> > >> > [INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
> > >> > [INFO] [INFO] Final Memory: 473M/1016M
> > >> > [INFO] [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [ERROR] BUILD ERROR
> > >> > [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] Maven execution failed, exit code: '1'
> > >> >
> > >> > [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] For more information, run Maven with the -e switch
> > >> > [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> > [INFO] Total time: 33 minutes 32 seconds
> > >> > [INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
> > >> > [INFO] Final Memory: 36M/65M
> > >> > [INFO]
> > >> >
> > ------------------------------------------------------------------------
> > >> >
> > >> > Thanks,
> > >> > Ryan
> > >> >
> > >>
> > >>
> > >>
> > >> --
> > >> Baptiste <Batmat> MATHUS - http://batmat.net
> > >> Sauvez un arbre,
> > >> Mangez un castor !
> > >>
> > >
> > >
> >
>
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>

Re: Question about Maven2 and Heap Space

Posted by Baptiste MATHUS <ml...@batmat.net>.
Sure, I already did that a couple of times. The more important and complex
part actually resides in the release:prepare goal.

Release:perform is basically just a svn checkout from the freshly created
tag (during the prepare) followed by a mvn deploy run from the checkouted
directory.

Cheers.

2009/6/8 Ryan Moquin <fr...@gmail.com>

> Ok, if I do just a mvn:deploy with 1024MB of memory, it fails at the same
> spot with what I think is the same stack trace:
>
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] FATAL ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Java heap space
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Trace
> java.lang.OutOfMemoryError: Java heap space
>         at java.util.Arrays.copyOf(Arrays.java:2786)
>         at
> java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
>         at
> sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
>         at
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
>         at
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
>         at
> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
>         at
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
>         at
> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
>         at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
>         at
>
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
>         at
>
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
>         at
>
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
>         at
> org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
>         at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
> )
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>         at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>         at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>         at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>         at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>         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)
>         at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>         at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>         at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>         at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 28 minutes 3 seconds
> [INFO] Finished at: Mon Jun 08 16:10:21 EDT 2009
> [INFO] Final Memory: 459M/992M
> [INFO]
> ------------------------------------------------------------------------
>
> If I use 1284 with either goal (release:perform or deploy), my project
> fails
> a lot sooner with an OOME at growableArray.cpp (at that point the heap is
> only at 500MB) .. which makes no sense since with deploy only one JVM is
> running at 1284 and fails, but with release:perform using 1024, there are
> two JVMs running with 1024MB of memory.. so something has to be wrong with
> the JVM with that much memory.
>
> Once again, once the checkout is done in target, can I just do a mvn deploy
> on the individuals modules to effectively finish the release:perform?  It's
> the only way I'm going to be able to finish my release.
>
> Thanks,
> Ryan
>
> On Mon, Jun 8, 2009 at 11:51 AM, Ryan Moquin <fr...@gmail.com>
> wrote:
>
> > It looks like it does fork since if I use jconsole, I will get a second
> JVM
> > that has identical properties as the first.  Part of the issue with this
> is
> > I notice that both JVMs will have the amount of memory I specify for
> > MAVEN_OPTS.  In the above case, 1GB.  If I run release:perform, the
> forked
> > JVM is maxed at 1 GB of memory when the error occurs.
> >
> > I did try to run the JVM with 1284 MB for the maven instance (which is
> the
> > highest I can run it where the JVM will start), but in that case, my
> build
> > dies sooner because it can't allocate enough memory for the forked
> > instance.  The initial instance of Maven2 only uses 40K of memory, so
> it's
> > unnecessary for it to have as much memory as the spawned process.  The
> > server I'm building on, has 4GB of physical memory, but apparently enough
> > isn't available to have the initial Maven2 instance and the spawned one
> both
> > running at 1284MB of memory.
> >
> > Other than checking out the tag, is the only other thing that the
> > release:perform does is a "deploy"?
> >
> > Ryan
> >
> >
> > On Mon, Jun 8, 2009 at 10:35 AM, Baptiste MATHUS <ml...@batmat.net> wrote:
> >
> >> Interesting. The artifact you're trying to deploy is 350MB+ large.
> >> Could you please try and just "mvn deploy" your project?
> >>
> >> I don't remember is the release plugin forks or not.
> >>
> >> My 2 cents,
> >> Cheers
> >>
> >> 2009/6/8 Ryan Moquin <fr...@gmail.com>
> >>
> >> > I'm trying to figure out why maven 2.1 is running out of heap space
> when
> >> I
> >> > do a release:perform on my project.  The project builds fine until I
> do
> >> a
> >> > release:perform in which case it runs out of memory.  The stack trace
> >> seems
> >> > to indicate that there was enough memory.  Do I need to give more
> memory
> >> to
> >> > the release plugin?  Here is the stacktrace, it seems like there is a
> >> > spawned JVM at the time of the error which doesn't have enough memory:
> >> >
> >> > [INFO] 262144/351338K
> >> > [INFO] 262148/351338K
> >> > [INFO] [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] [ERROR] FATAL ERROR
> >> > [INFO] [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] [INFO] Java heap space
> >> > [INFO] [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] [INFO] Trace
> >> > [INFO] java.lang.OutOfMemoryError: Java heap space
> >> > [INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
> >> > [INFO]  at
> >> > java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
> >> > [INFO]  at
> >> > sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
> >> > [INFO]  at
> >> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
> >> > [INFO]  at
> >> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
> >> > [INFO]  at
> >> >
> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
> >> > [INFO]  at
> >> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
> >> > [INFO]  at
> >> >
> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
> >> > [INFO]  at
> org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
> >> > [INFO]  at
> >> > org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
> >> > )
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> >> > [INFO]  at
> >> >
> >> >
> >>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> >> > [INFO]  at
> >> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> >> > [INFO]  at
> org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> >> > [INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
> >> > [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >> > [INFO]  at
> >> >
> >> >
> >>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> >> > [INFO]  at
> >> >
> >> >
> >>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> >> > [INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
> >> > [INFO]  at
> >> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> >> > [INFO]  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> >> > [INFO]  at
> >> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> >> > [INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> >> > [INFO] [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] [INFO] Total time: 30 minutes 19 seconds
> >> > [INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
> >> > [INFO] [INFO] Final Memory: 473M/1016M
> >> > [INFO] [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [ERROR] BUILD ERROR
> >> > [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] Maven execution failed, exit code: '1'
> >> >
> >> > [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] For more information, run Maven with the -e switch
> >> > [INFO]
> >> >
> ------------------------------------------------------------------------
> >> > [INFO] Total time: 33 minutes 32 seconds
> >> > [INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
> >> > [INFO] Final Memory: 36M/65M
> >> > [INFO]
> >> >
> ------------------------------------------------------------------------
> >> >
> >> > Thanks,
> >> > Ryan
> >> >
> >>
> >>
> >>
> >> --
> >> Baptiste <Batmat> MATHUS - http://batmat.net
> >> Sauvez un arbre,
> >> Mangez un castor !
> >>
> >
> >
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !

Re: Question about Maven2 and Heap Space

Posted by Ryan Moquin <fr...@gmail.com>.
Ok, if I do just a mvn:deploy with 1024MB of memory, it fails at the same
spot with what I think is the same stack trace:

[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Java heap space
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.OutOfMemoryError: Java heap space
        at java.util.Arrays.copyOf(Arrays.java:2786)
        at
java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
        at
sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
        at
org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
        at
org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
        at
org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
        at
org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
        at
org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
        at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
        at
org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
        at
org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
        at
org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
        at
org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
        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)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 28 minutes 3 seconds
[INFO] Finished at: Mon Jun 08 16:10:21 EDT 2009
[INFO] Final Memory: 459M/992M
[INFO]
------------------------------------------------------------------------

If I use 1284 with either goal (release:perform or deploy), my project fails
a lot sooner with an OOME at growableArray.cpp (at that point the heap is
only at 500MB) .. which makes no sense since with deploy only one JVM is
running at 1284 and fails, but with release:perform using 1024, there are
two JVMs running with 1024MB of memory.. so something has to be wrong with
the JVM with that much memory.

Once again, once the checkout is done in target, can I just do a mvn deploy
on the individuals modules to effectively finish the release:perform?  It's
the only way I'm going to be able to finish my release.

Thanks,
Ryan

On Mon, Jun 8, 2009 at 11:51 AM, Ryan Moquin <fr...@gmail.com> wrote:

> It looks like it does fork since if I use jconsole, I will get a second JVM
> that has identical properties as the first.  Part of the issue with this is
> I notice that both JVMs will have the amount of memory I specify for
> MAVEN_OPTS.  In the above case, 1GB.  If I run release:perform, the forked
> JVM is maxed at 1 GB of memory when the error occurs.
>
> I did try to run the JVM with 1284 MB for the maven instance (which is the
> highest I can run it where the JVM will start), but in that case, my build
> dies sooner because it can't allocate enough memory for the forked
> instance.  The initial instance of Maven2 only uses 40K of memory, so it's
> unnecessary for it to have as much memory as the spawned process.  The
> server I'm building on, has 4GB of physical memory, but apparently enough
> isn't available to have the initial Maven2 instance and the spawned one both
> running at 1284MB of memory.
>
> Other than checking out the tag, is the only other thing that the
> release:perform does is a "deploy"?
>
> Ryan
>
>
> On Mon, Jun 8, 2009 at 10:35 AM, Baptiste MATHUS <ml...@batmat.net> wrote:
>
>> Interesting. The artifact you're trying to deploy is 350MB+ large.
>> Could you please try and just "mvn deploy" your project?
>>
>> I don't remember is the release plugin forks or not.
>>
>> My 2 cents,
>> Cheers
>>
>> 2009/6/8 Ryan Moquin <fr...@gmail.com>
>>
>> > I'm trying to figure out why maven 2.1 is running out of heap space when
>> I
>> > do a release:perform on my project.  The project builds fine until I do
>> a
>> > release:perform in which case it runs out of memory.  The stack trace
>> seems
>> > to indicate that there was enough memory.  Do I need to give more memory
>> to
>> > the release plugin?  Here is the stacktrace, it seems like there is a
>> > spawned JVM at the time of the error which doesn't have enough memory:
>> >
>> > [INFO] 262144/351338K
>> > [INFO] 262148/351338K
>> > [INFO] [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] [ERROR] FATAL ERROR
>> > [INFO] [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] [INFO] Java heap space
>> > [INFO] [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] [INFO] Trace
>> > [INFO] java.lang.OutOfMemoryError: Java heap space
>> > [INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
>> > [INFO]  at
>> > java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
>> > [INFO]  at
>> > sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
>> > [INFO]  at
>> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
>> > [INFO]  at
>> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
>> > [INFO]  at
>> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
>> > [INFO]  at
>> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
>> > [INFO]  at
>> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
>> > [INFO]  at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
>> > [INFO]  at
>> > org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
>> > )
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
>> > [INFO]  at
>> >
>> >
>> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
>> > [INFO]  at
>> org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
>> > [INFO]  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
>> > [INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
>> > [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > [INFO]  at
>> >
>> >
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> > [INFO]  at
>> >
>> >
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
>> > [INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
>> > [INFO]  at
>> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
>> > [INFO]  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
>> > [INFO]  at
>> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
>> > [INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
>> > [INFO] [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] [INFO] Total time: 30 minutes 19 seconds
>> > [INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
>> > [INFO] [INFO] Final Memory: 473M/1016M
>> > [INFO] [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO]
>> > ------------------------------------------------------------------------
>> > [ERROR] BUILD ERROR
>> > [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] Maven execution failed, exit code: '1'
>> >
>> > [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] For more information, run Maven with the -e switch
>> > [INFO]
>> > ------------------------------------------------------------------------
>> > [INFO] Total time: 33 minutes 32 seconds
>> > [INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
>> > [INFO] Final Memory: 36M/65M
>> > [INFO]
>> > ------------------------------------------------------------------------
>> >
>> > Thanks,
>> > Ryan
>> >
>>
>>
>>
>> --
>> Baptiste <Batmat> MATHUS - http://batmat.net
>> Sauvez un arbre,
>> Mangez un castor !
>>
>
>

Re: Question about Maven2 and Heap Space

Posted by Ryan Moquin <fr...@gmail.com>.
It looks like it does fork since if I use jconsole, I will get a second JVM
that has identical properties as the first.  Part of the issue with this is
I notice that both JVMs will have the amount of memory I specify for
MAVEN_OPTS.  In the above case, 1GB.  If I run release:perform, the forked
JVM is maxed at 1 GB of memory when the error occurs.

I did try to run the JVM with 1284 MB for the maven instance (which is the
highest I can run it where the JVM will start), but in that case, my build
dies sooner because it can't allocate enough memory for the forked
instance.  The initial instance of Maven2 only uses 40K of memory, so it's
unnecessary for it to have as much memory as the spawned process.  The
server I'm building on, has 4GB of physical memory, but apparently enough
isn't available to have the initial Maven2 instance and the spawned one both
running at 1284MB of memory.

Other than checking out the tag, is the only other thing that the
release:perform does is a "deploy"?

Ryan

On Mon, Jun 8, 2009 at 10:35 AM, Baptiste MATHUS <ml...@batmat.net> wrote:

> Interesting. The artifact you're trying to deploy is 350MB+ large.
> Could you please try and just "mvn deploy" your project?
>
> I don't remember is the release plugin forks or not.
>
> My 2 cents,
> Cheers
>
> 2009/6/8 Ryan Moquin <fr...@gmail.com>
>
> > I'm trying to figure out why maven 2.1 is running out of heap space when
> I
> > do a release:perform on my project.  The project builds fine until I do a
> > release:perform in which case it runs out of memory.  The stack trace
> seems
> > to indicate that there was enough memory.  Do I need to give more memory
> to
> > the release plugin?  Here is the stacktrace, it seems like there is a
> > spawned JVM at the time of the error which doesn't have enough memory:
> >
> > [INFO] 262144/351338K
> > [INFO] 262148/351338K
> > [INFO] [INFO]
> > ------------------------------------------------------------------------
> > [INFO] [ERROR] FATAL ERROR
> > [INFO] [INFO]
> > ------------------------------------------------------------------------
> > [INFO] [INFO] Java heap space
> > [INFO] [INFO]
> > ------------------------------------------------------------------------
> > [INFO] [INFO] Trace
> > [INFO] java.lang.OutOfMemoryError: Java heap space
> > [INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
> > [INFO]  at
> > java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
> > [INFO]  at
> > sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
> > [INFO]  at
> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
> > [INFO]  at
> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
> > [INFO]  at
> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
> > [INFO]  at
> > org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
> > [INFO]  at
> > org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
> > [INFO]  at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
> > [INFO]  at
> >
> >
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
> > [INFO]  at
> >
> >
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
> > [INFO]  at
> >
> >
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
> > [INFO]  at
> > org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
> > [INFO]  at
> >
> >
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> > [INFO]  at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> > [INFO]  at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
> > [INFO]  at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
> > [INFO]  at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
> > )
> > [INFO]  at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> > [INFO]  at
> >
> >
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> > [INFO]  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> > [INFO]  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> > [INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
> > [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> > [INFO]  at
> >
> >
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> > [INFO]  at
> >
> >
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> > [INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
> > [INFO]  at
> > org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> > [INFO]  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> > [INFO]  at
> > org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> > [INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> > [INFO] [INFO]
> > ------------------------------------------------------------------------
> > [INFO] [INFO] Total time: 30 minutes 19 seconds
> > [INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
> > [INFO] [INFO] Final Memory: 473M/1016M
> > [INFO] [INFO]
> > ------------------------------------------------------------------------
> > [INFO]
> > ------------------------------------------------------------------------
> > [ERROR] BUILD ERROR
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Maven execution failed, exit code: '1'
> >
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] For more information, run Maven with the -e switch
> > [INFO]
> > ------------------------------------------------------------------------
> > [INFO] Total time: 33 minutes 32 seconds
> > [INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
> > [INFO] Final Memory: 36M/65M
> > [INFO]
> > ------------------------------------------------------------------------
> >
> > Thanks,
> > Ryan
> >
>
>
>
> --
> Baptiste <Batmat> MATHUS - http://batmat.net
> Sauvez un arbre,
> Mangez un castor !
>

Re: Question about Maven2 and Heap Space

Posted by Baptiste MATHUS <ml...@batmat.net>.
Interesting. The artifact you're trying to deploy is 350MB+ large.
Could you please try and just "mvn deploy" your project?

I don't remember is the release plugin forks or not.

My 2 cents,
Cheers

2009/6/8 Ryan Moquin <fr...@gmail.com>

> I'm trying to figure out why maven 2.1 is running out of heap space when I
> do a release:perform on my project.  The project builds fine until I do a
> release:perform in which case it runs out of memory.  The stack trace seems
> to indicate that there was enough memory.  Do I need to give more memory to
> the release plugin?  Here is the stacktrace, it seems like there is a
> spawned JVM at the time of the error which doesn't have enough memory:
>
> [INFO] 262144/351338K
> [INFO] 262148/351338K
> [INFO] [INFO]
> ------------------------------------------------------------------------
> [INFO] [ERROR] FATAL ERROR
> [INFO] [INFO]
> ------------------------------------------------------------------------
> [INFO] [INFO] Java heap space
> [INFO] [INFO]
> ------------------------------------------------------------------------
> [INFO] [INFO] Trace
> [INFO] java.lang.OutOfMemoryError: Java heap space
> [INFO]  at java.util.Arrays.copyOf(Arrays.java:2786)
> [INFO]  at
> java.io.ByteArrayOutputStream.write(ByteArrayOutputStream.java:94)
> [INFO]  at
> sun.net.www.http.PosterOutputStream.write(PosterOutputStream.java:61)
> [INFO]  at
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:492)
> [INFO]  at
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:457)
> [INFO]  at
> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:411)
> [INFO]  at
> org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:392)
> [INFO]  at
> org.apache.maven.wagon.AbstractWagon.putTransfer(AbstractWagon.java:365)
> [INFO]  at org.apache.maven.wagon.StreamWagon.put(StreamWagon.java:160)
> [INFO]  at
>
> org.apache.maven.artifact.manager.DefaultWagonManager.putRemoteFile(DefaultWagonManager.java:262)
> [INFO]  at
>
> org.apache.maven.artifact.manager.DefaultWagonManager.putArtifact(DefaultWagonManager.java:172)
> [INFO]  at
>
> org.apache.maven.artifact.deployer.DefaultArtifactDeployer.deploy(DefaultArtifactDeployer.java:107)
> [INFO]  at
> org.apache.maven.plugin.deploy.DeployMojo.execute(DeployMojo.java:190)
> [INFO]  at
>
> org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:483)
> [INFO]  at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:678)
> [INFO]  at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:540)
> [INFO]  at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:519)
> [INFO]  at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:371
> )
> [INFO]  at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:332)
> [INFO]  at
>
> org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:181)
> [INFO]  at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:356)
> [INFO]  at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
> [INFO]  at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
> [INFO]  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> [INFO]  at
>
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> [INFO]  at
>
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> [INFO]  at java.lang.reflect.Method.invoke(Method.java:597)
> [INFO]  at
> org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
> [INFO]  at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
> [INFO]  at
> org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
> [INFO]  at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
> [INFO] [INFO]
> ------------------------------------------------------------------------
> [INFO] [INFO] Total time: 30 minutes 19 seconds
> [INFO] [INFO] Finished at: Sat Jun 06 02:19:04 EDT 2009
> [INFO] [INFO] Final Memory: 473M/1016M
> [INFO] [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] BUILD ERROR
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Maven execution failed, exit code: '1'
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] For more information, run Maven with the -e switch
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 33 minutes 32 seconds
> [INFO] Finished at: Sat Jun 06 02:19:21 EDT 2009
> [INFO] Final Memory: 36M/65M
> [INFO]
> ------------------------------------------------------------------------
>
> Thanks,
> Ryan
>



-- 
Baptiste <Batmat> MATHUS - http://batmat.net
Sauvez un arbre,
Mangez un castor !