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 8291889
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T13:17:00+00:00 2026-06-08T13:17:00+00:00

I am trying to use maven for my project work but i am stuck

  • 0

I am trying to use maven for my project work but i am stuck with memory related issues.

When i run the maven i get the heap space error which i fixed using the following line

set MAVEN_OPTS="-Xmx1586m"

after this when i run the maven again, i don’t get the heap space error but rather i get the PermGen space error. For solving that i used the following syntax

set MAVEN_OPTS="-Xmx1586m -XX:MaxPermSize=512m"

but once i start using the MaxPermSize option i get the following error

Invalid maximum heap size: -Xmx1586m -XX:MaxPermSize=512m

Could not create the Java virtual machine.

I have tried setting different value combination for Xmx and MaxPermSize to bring the size in control but all are invalid.

I get this error only when i put MaxPermSize option in the MAVEN_OPTS. Once i remove that option i don’t get the error mentioned above but i do get the PermGen error.

Any suggestions what I am doing wrong?

  • 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-08T13:17:01+00:00Added an answer on June 8, 2026 at 1:17 pm

    you can try to set the initial heap size and initial permgen size relatively small, but set the proper max heap and pergent via -Xms128m -Xmx1024m -XX:PermSize=128m -XX:MaxPermSize=256m

    Also don’t set permgen to 512 – it’s too much for typical scenarious.

    Also you may want to use fork option with maven and start plugin execution in different JVMs at all.

    For example

    <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <fork>true</fork>
        </configuration>
      </plugin>
    

    Also, while allocating memory also make sure that you have that much free memory available.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use proguard in a Maven project this is a obfuscate plugin,
I'm trying to use Maven2 but my child projects cannot find the parent project.
I am trying to get setup to use Maven and pom.xml files in Eclipse
I've got a Maven project that I'm trying to configure to use the maven
I'm trying to use apache hive in a maven project. I wanted to use
Hi I'm trying to use the maven android plugin and robolectric to get tests
I'm trying to use Maven to build a Flex project using the Sonatype flexmojos.
I'm trying to use Maven for new projects, but this thing is confusing me
I've been trying to use Maven to build a project. The project builds fine
I'm trying to use Jetty in a Netbeans Maven Web Project (instead of Glassfish

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.