Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9105621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:09:03+00:00 2026-06-17T02:09:03+00:00

I am analysing a large project in Sonar and get the following error: [sonar:sonar]

  • 0

I am analysing a large project in Sonar and get the following error:

[sonar:sonar] 03:55:39.511 INFO  p.PhasesTimeProfiler - Execute decorators...

BUILD FAILED
[...]
[...] java.lang.OutOfMemoryError: Java heap space
at org.sonar.batch.index.MeasurePersister.model(MeasurePersister.java:127)
at org.sonar.batch.index.MeasurePersister.getMeasuresToSave(MeasurePersister.java:117)
at org.sonar.batch.index.MeasurePersister.dump(MeasurePersister.java:70)
at org.sonar.batch.index.DefaultPersistenceManager.dump(DefaultPersistenceManager.java:63)
at org.sonar.batch.phases.Phases.execute(Phases.java:95)
at org.sonar.batch.bootstrap.ProjectModule.doStart(ProjectModule.java:139)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BatchModule.analyze(BatchModule.java:131)
at org.sonar.batch.bootstrap.BatchModule.doStart(BatchModule.java:121)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.bootstrap.BootstrapModule.doStart(BootstrapModule.java:121)
at org.sonar.batch.bootstrap.Module.start(Module.java:83)
at org.sonar.batch.Batch.execute(Batch.java:104)
at org.sonar.ant.Launcher.execute(Launcher.java:78)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.sonar.ant.SonarTask.delegateExecution(SonarTask.java:244)
at org.sonar.ant.SonarTask.execute(SonarTask.java:193)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:616)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:392)
at org.apache.tools.ant.Target.performTasks(Target.java:413)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:38)
at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:442)

Should I increase the java heap space of the running Sonar server, or the Ant target executing the Sonar job?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:09:04+00:00Added an answer on June 17, 2026 at 2:09 am

    As you can see from the stack trace, the Ant starts the Sonar analysis, so you should increase the heap space for the VM the Ant runs in.

    This is a very similar question BTW: How to increase Sonar Java heap space

    For command line Ant usage

    Quote from the answer by Mark O’Connor on the other question:

    The Sonar ANT task executes as part of ANT so you need to set the JVM heap using the standard ANT environment parameter. For example:

    export ANT_OPTS=-Xmx256m

    Remarks:

    • this is for Linux, for Windows, use the set command
    • this is strictly for the heap space. for Permgen, use -XX:MaxPermSize=<desired amount>

    This is an even more similar question: Build Failed java.lang.OutOfMemoryError: Java heap space

    For Eclipse IDE

    Quote from the article http://soenkerohde.com/2008/06/change-eclipse-ant-settings-when-you-run-out-of-memory/

    • In Eclipse open menu: Run->External Tools->Open External Tools Dialog…
    • Select the build script you want to change on the left
    • Select the JRE tab on the right
    • Set the following as VM arguments: -Xms768m -Xmx1024m -XX:MaxPermSize=512m

    For IntelliJ Idea

    This forum thread is useful: ANT build java heap space

    Quote from the answers:

    Please make sure that you increased heap in a correct place. You need to click ‘Properties’ button in IDEA’s Ant tool window and edit ‘Maximum heap size (Mb)’ field there.

    Also, from the IntelliJ Idea page: Increasing Memory Heap

    Quote from the article:

    The memory heap of the build process is independent of IntelliJ IDEA memory heap, and is released after the build process is complete.

    To increase a memory heap:
    Open the Build File Properties dialog box.
    In the Maximum heap size field, type the required amount of memory.

    For Jenkins Continuous Integration and Ant build

    This question is useful : How to use the Java Options in jenkins ant build tool to set ANT_OPTS

    Quote from the answer:

    Set the JAVA OPTIONS as -Xmx512m -XX:MaxPermSize=256m only without the ANT_OPTS=

    For Maven builds, this article is of use: How to increase maven heapspace in hudson builds

    1. Navigate to your hudson job,
    2. click Configure,
    3. scroll down to the Build section, and
    4. click the Advanced button.
    5. Enter this into MAVEN_OPTS: -Xmx512m -XX:MaxPermSize=128m
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I maintain the build process for a large (> 500,000 LOC) Java project. I've
I'm analysing some imaging data that consists of large 3-dimensional arrays of pixel intensities
I'd like to find out what has changed between versions of a large project
We're often working on a project where we've been handed a large data set
I'm doing a study on large Java projects and would like to view the
Looking to improve quality of a fairly large Python project. I am happy with
Regarding my previous question ( How to quickly build large scale analytics server? )
I just refactored a small part of a large project grown over years to
I am working on a project that deals with analyzing a very large amount
I have a huge project, something about 150 000 LOC of C++ code. Build

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.