TestingDocs.com
Software Testing website
  • Automation
    • Selenium
    • JBehave Framework
  • Tutorials
    • MySQL Tutorials
    • Testlink
    • Maven
    • Git
  • IDEs
    • IntelliJ IDEA
    • Eclipse
  • Flowcharts
    • Flowgorithm
    • Raptor
  • About

JBehave

MAVEN_OPTS : How to increase JVM memory

JBehave

Introduction

In this post, we will see how to increase JVM memory using the environment variable MAVEN_OPTS. MAVEN_OPTS is the Java runtime options used when Maven is run. Sometimes, while running a large number of JBehave stories we might get OutOfMemoryError at runtime.

For example, we might get something like this:

Caused by: java.lang.OutOfMemoryError: PermGen space

What is MAVEN_OPTS?

MAVEN_OPTS is an environment variable. It defines options for the JVM that executes Maven. We can set/increase JVM memory with this variable. We can set it according to our operating system.

Setting MAVEN_OPTS

For example, on *nix system we can use

export MAVEN_OPTS=

On Windows, we can use

set MAVEN_OPTS=

If you are getting an OutOfMemoryException when running maven, we can try increasing the JVM memory to resolve this error.

MAVEN_OPTS="-Xmx512M -XX:MaxPermSize=512m"

This will allocate 512MB of RAM to Maven.

On Windows Operating system

We can set or increase memory in many ways.

For example: using the windows command prompt

/> set MAVEN_OPTS=”-Xmx512M -XX:MaxPermSize=512m”

We may also set the  variable  in Environment variables in

Control Panel >> System >> Advanced >>  Environment Variables…

 

Environment_Variable_Windows

 

To enter new variable click on ‘New’ under user variables, then enter MAVEN_OPTS as the variable name and the value

"-Xmx512M -XX:MaxPermSize=512m"

If you already have set the environment variable, edit it to increase the memory. Also, note that the value 512M is chosen for example sake. The most suitable value depends and varies with the environment.

 

JBehave Tutorials on this website can be found at:
https://www.testingdocs.com/jbehave-framework-tutorial/

For more details on the JBehave framework, visit the official JBehave website at:
http://jbehave.org

Related Posts

Create a New Project Eclipse

JBehave /

Cucumber Java BDD Selenium Framework

JBehave + Serenity Sample Project

JBehave /

JBehave + Serenity Sample Project

Serenity BDD Automation Framework

JBehave /

Serenity BDD Automation Framework

Serenity Maven Artifacts

JBehave /

Serenity Maven Artifacts

Introduction to Serenity BDD

JBehave /

Introduction to Serenity BDD

‹ Write Step Class for a JBehave Story› BDD Java Frameworks

Recent Posts

  • MS Access Data Types
  • Install RAPTOR Avalonia on CentOS
  • Download RAPTOR Avalonia Edition on Windows
  • npm doctor command
  • Build & Run CLion Project
  • Create New CLion C Project on Windows
  • Configure CLion Toolchains on Windows
  • Launch CLion IDE on Windows
  • Activate CLion IDE
  • CLion IDE for C/C++ Development

Back to Top

Links

  • Contact
  • Privacy Policy
  • Cookie Policy

www.TestingDocs.com

Go to mobile version