outofmemory error to execute sonar in multiple-project env

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

outofmemory error to execute sonar in multiple-project env

Xiaojian Ao
hi

    I tried to use sonar in a multiple-projects env and failure with outofmemory error.

    I have 4 projects and in each project there are only several small (less than 10) java classes. So the size of projects / class
is not the reason of outofmemory error.

    When I use 'gradle -a sonar' to execute sonar command in each subject, it works well. 

    I used grade 1.0-M3 and latest sonar version 2.7.

    It seems a bug in gradle ? 

    
Sky Ao 
Reply | Threaded
Open this post in threaded view
|

Re: outofmemory error to execute sonar in multiple-project env

Peter Niederwieser
Xiaojian Ao wrote
It seems a bug in gradle ?
Hard to say. Basically all we do is to call the Sonar API. And as far as I can tell, we don't hold on to anything after a subproject has been analyzed. I'll have to look at this in the profiler again.

In order to analyze the whole Gradle project with Sonar (which took about 90 minutes), I used the following memory settings:

export GRADLE_OPTS="-Xmx1G -XX:MaxPermSize=512m"

As far as I remember, -Xmx512m wasn't enough in this case.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Blog: http://pniederw.wordpress.com
Twitter: @pniederw
Reply | Threaded
Open this post in threaded view
|

Re: outofmemory error to execute sonar in multiple-project env

Spencer Allain
I can confirm that running a multi-project build that invokes sonar on several sub-projects (in this case 5 for me) also fails with an OOME.  It fails once reaching the 3rd or 4th project it encounters -- cannot remember.

Invoking sonar individually on any of the sub-projects does not fail.

We were only testing out the sonar plugin and it's not currently part of our official build process, so I don't know when I'll get time to try to determine what's causing the underlying issue.

-Spencer

--- On Fri, 5/20/11, Peter Niederwieser <[hidden email]> wrote:

From: Peter Niederwieser <[hidden email]>
Subject: [gradle-user] Re: outofmemory error to execute sonar in multiple-project env
To: [hidden email]
Date: Friday, May 20, 2011, 9:58 AM


Xiaojian Ao wrote:
>
> It seems a bug in gradle ?
>

Hard to say. Basically all we do is to call the Sonar API. And as far as I
can tell, we don't hold on to anything after a subproject has been analyzed.
I'll have to look at this in the profiler again.

In order to analyze the whole Gradle project with Sonar (which took about 90
minutes), I used the following memory settings:

export GRADLE_OPTS="-Xmx1G -XX:MaxPermSize=512m"

As far as I remember, -Xmx512m wasn't enough in this case.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Blog: http://pniederw.wordpress.com
Twitter: @pniederw

--
View this message in context: http://gradle.1045684.n5.nabble.com/outofmemory-error-to-execute-sonar-in-multiple-project-env-tp4411892p4412648.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|

Re: outofmemory error to execute sonar in multiple-project env

Xiaojian Ao
Since there is no error to run sonar individually to each subproject, can we change the way that gradle run sonar for multiple projects?

We can start a jvm and run sonar for one project, when finished we can exist the jvm and restart a new jvm to run sonar for next subproject.Running Sonar in one subjuect is not dependent any other subproject, so I think this is a simple way to work around this issue.

How about you ?

Sky Ao
  

On Fri, May 20, 2011 at 10:30 PM, Spencer Allain <[hidden email]> wrote:
I can confirm that running a multi-project build that invokes sonar on several sub-projects (in this case 5 for me) also fails with an OOME.  It fails once reaching the 3rd or 4th project it encounters -- cannot remember.

Invoking sonar individually on any of the sub-projects does not fail.

We were only testing out the sonar plugin and it's not currently part of our official build process, so I don't know when I'll get time to try to determine what's causing the underlying issue.

-Spencer

--- On Fri, 5/20/11, Peter Niederwieser <[hidden email]> wrote:

From: Peter Niederwieser <[hidden email]>
Subject: [gradle-user] Re: outofmemory error to execute sonar in multiple-project env
To: [hidden email]
Date: Friday, May 20, 2011, 9:58 AM



Xiaojian Ao wrote:
>
> It seems a bug in gradle ?
>

Hard to say. Basically all we do is to call the Sonar API. And as far as I
can tell, we don't hold on to anything after a subproject has been analyzed.
I'll have to look at this in the profiler again.

In order to analyze the whole Gradle project with Sonar (which took about 90
minutes), I used the following memory settings:

export GRADLE_OPTS="-Xmx1G -XX:MaxPermSize=512m"

As far as I remember, -Xmx512m wasn't enough in this case.

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Blog: http://pniederw.wordpress.com
Twitter: @pniederw

--
View this message in context: http://gradle.1045684.n5.nabble.com/outofmemory-error-to-execute-sonar-in-multiple-project-env-tp4411892p4412648.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Reply | Threaded
Open this post in threaded view
|

Re: outofmemory error to execute sonar in multiple-project env

Peter Niederwieser
Xiaojian Ao wrote
We can start a jvm and run sonar for one project, when finished we can exist
the jvm and restart a new jvm to run sonar for next subproject.Running Sonar
in one subjuect is not dependent any other subproject, so I think this is a
simple way to work around this issue.
Forking is an option but would require some work because we integrate with Sonar via its Java API rather than an executable. And once Sonar's API supports multi-projects, we can at most fork one JVM. So I think it's better to profile the Gradle build first and try to understand who's using that much memory.

Have you tried to increase the memory limits as I've described?

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Blog: http://pniederw.wordpress.com
Twitter: @pniederw
Reply | Threaded
Open this post in threaded view
|

Re: outofmemory error to execute sonar in multiple-project env

Xiaojian Ao
In windows, set GRADLE_OPTS to "-Xmx1G -XX:MaxPermSize=512m", sonar command fails to start jvm:

Error occurred during initialization of VM
Could not reserve enough space for object heap
Could not create the Java virtual machine.

I changed to "-Xmx1G -XX:MaxPermSize=256m", it  succeeds.



On Sat, May 21, 2011 at 10:35 AM, Peter Niederwieser <[hidden email]> wrote:

Xiaojian Ao wrote:
>
> We can start a jvm and run sonar for one project, when finished we can
> exist
> the jvm and restart a new jvm to run sonar for next subproject.Running
> Sonar
> in one subjuect is not dependent any other subproject, so I think this is
> a
> simple way to work around this issue.
>

Forking is an option but would require some work because we integrate with
Sonar via its Java API rather than an executable. And once Sonar's API
supports multi-projects, we can at most fork one JVM. So I think it's better
to profile the Gradle build first and try to understand who's using that
much memory.

Have you tried to increase the memory limits as I've described?

--
Peter Niederwieser
Principal Engineer, Gradleware
http://gradleware.com
Creator, Spock Framework
http://spockframework.org
Blog: http://pniederw.wordpress.com
Twitter: @pniederw

--
View this message in context: http://gradle.1045684.n5.nabble.com/outofmemory-error-to-execute-sonar-in-multiple-project-env-tp4411892p4414007.html
Sent from the gradle-user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email