How to change tomcat memory during integration tests?

Using atlas-integration-test, I get out of memory shortly after tomcat starts:

[INFO] [talledLocalContainer] ERROR - 15:47:50,982 -            com.atlassian.plugin.loaders.ScanningPluginLoader - [localhost-startStop-1] - Because of the following exception:
[INFO] [talledLocalContainer] java.lang.OutOfMemoryError: Java heap space

Above that, I see:

[INFO] [talledLocalContainer] INFO: Command line argument: -Xmx512m
[INFO] [talledLocalContainer] Dec 18, 2019 3:47:34 PM org.apache.catalina.startup.VersionLoggerListener log
[INFO] [talledLocalContainer] INFO: Command line argument: -Xms128m

The scanner is failing to do its job resulting in the main plugin failing to load; so, of course all the integration tests fail.

How do I change this? How do I give tomcat more heap?

More importantly, where is this documented!?! I shouldn’t have to go to a forum to find basic information such as this.

The documentation for atlas-run and atlas-debug state that you can pass JVM Arguments through:
https://developer.atlassian.com/server/framework/atlassian-sdk/atlas-run/

atlas-run --jvmargs "-Xmx1024m -Xms1024m"

Alternatively, you can use the documented Atlassian Maven plugin configuration, which is set in your pom.xml file:
https://developer.atlassian.com/server/framework/atlassian-sdk/amps-build-configuration-reference/

<plugin>
    <groupId>com.atlassian.maven.plugins</groupId>
    <artifactId>jira-maven-plugin</artifactId>
    <version>8.0.0</version>
    <extensions>true</extensions>
    <configuration>
        <productVersion>${jira.version}</productVersion>
        <productDataVersion>${jira.version}</productDataVersion>
        <jvmArgs>-Xms1024m -Xmx1024m</jvmArgs>
    </configuration>
</plugin>

If it works… :man_shrugging:
You can also go to the slack channel: http://signup.marketplace-vendor-resources.com
Or look at the vendor community curated list of resources (to which you can also contribute): http://docs.marketplace-vendor-resources.com

This is already set:

<jvmArgs>-Xms1g -Xmx2g -XX:-UseGCOverheadLimit -server</jvmArgs>

It doesn’t get passed to the refapp’s tomcat.

1 Like

I created a new refapp plugin:

sbehnke-mbp15:Projects sbehnke$ atlas-create-refapp-plugin
Executing: /usr/local/Cellar/atlassian-plugin-sdk/8.0.7/libexec/apache-maven-3.5.4/bin/mvn com.atlassian.maven.plugins:refapp-maven-plugin:8.0.0:create -gs /usr/local/Cellar/atlassian-plugin-sdk/8.0.7/libexec/apache-maven-3.5.4/conf/settings.xml
[WARNING] 
[WARNING] Some problems were encountered while building the effective settings
[WARNING] 'profiles.profile[defaultProfile].repositories.repository.id' must be unique but found duplicate repository with id atlassian-public @ /usr/local/Cellar/atlassian-plugin-sdk/8.0.7/libexec/apache-maven-3.5.4/conf/settings.xml
[WARNING] 'profiles.profile[defaultProfile].repositories.repository.id' must be unique but found duplicate repository with id atlassian-public @ /usr/local/Cellar/atlassian-plugin-sdk/8.0.7/libexec/apache-maven-3.5.4/conf/settings.xml
[WARNING] 
[INFO] Scanning for projects...
Downloading from atlassian-public: https://maven.atlassian.com/repository/public/com/atlassian/maven/plugins/refapp-maven-plugin/8.0.0/refapp-maven-plugin-8.0.0.pom
Downloaded from atlassian-public: https://maven.atlassian.com/repository/public/com/atlassian/maven/plugins/refapp-maven-plugin/8.0.0/refapp-maven-plugin-8.0.0.pom (3.0 kB at 3.4 kB/s)
Downloading from atlassian-public: https://maven.atlassian.com/repository/public/com/atlassian/maven/plugins/refapp-maven-plugin/8.0.0/refapp-maven-plugin-8.0.0.jar
Downloaded from atlassian-public: https://maven.atlassian.com/repository/public/com/atlassian/maven/plugins/refapp-maven-plugin/8.0.0/refapp-maven-plugin-8.0.0.jar (76 kB at 131 kB/s)
[INFO] 
[INFO] ------------------< org.apache.maven:standalone-pom >-------------------
[INFO] Building Maven Stub Project (No POM) 1
[INFO] --------------------------------[ pom ]---------------------------------
[INFO] 
[INFO] --- refapp-maven-plugin:8.0.0:create (default-cli) @ standalone-pom ---
[INFO] Google Analytics Tracking is enabled to collect AMPS usage statistics.
[INFO] Although no personal information is sent, you may disable tracking by adding <allowGoogleTracking>false</allowGoogleTracking> to the amps plugin configuration in your pom.xml
[INFO] Sending event to Google Analytics: AMPS:refapp - SDK First Run - 8.0.0
[INFO] using stable product version: 5.0.0
[INFO] using stable data version: 5.0.0
Define value for groupId: : com.spacex.refapp.test
Define value for artifactId: : test-artifact
Define value for version:  1.0.0-SNAPSHOT: : 
Define value for package:  com.spacex.refapp.test: : 
Confirm properties configuration:
groupId: com.spacex.refapp.test
artifactId: test-artifact
version: 1.0.0-SNAPSHOT
package: com.spacex.refapp.test
 Y: : y
[INFO] Generating project in Batch mode
[INFO] Archetype repository not defined. Using the one from [com.atlassian.maven.archetypes:refapp-plugin-archetype:5.0.18] found in catalog remote
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype: refapp-plugin-archetype:8.0.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.spacex.refapp.test
[INFO] Parameter: artifactId, Value: test-artifact
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: package, Value: com.spacex.refapp.test
[INFO] Parameter: packageInPathFormat, Value: com/spacex/refapp/test
[INFO] Parameter: refappVersion, Value: 5.0.0
[INFO] Parameter: crowdDataVersion, Value: 3.3.3
[INFO] Parameter: refappDataVersion, Value: 5.0.0
[INFO] Parameter: confluenceVersion, Value: 6.14.0
[INFO] Parameter: artifactId, Value: test-artifact
[INFO] Parameter: fecruDataVersion, Value: 4.6.1-20181008080545
[INFO] Parameter: package, Value: com.spacex.refapp.test
[INFO] Parameter: version, Value: 1.0.0-SNAPSHOT
[INFO] Parameter: groupId, Value: com.spacex.refapp.test
[INFO] Parameter: bambooDataVersion, Value: 6.8.0
[INFO] Parameter: jiraDataVersion, Value: 7.13.0
[INFO] Parameter: platformVersion, Value: 5.0.0
[INFO] Parameter: fecruVersion, Value: 4.6.1-20181008080545
[INFO] Parameter: bambooVersion, Value: 6.8.0
[INFO] Parameter: crowdVersion, Value: 3.3.3
[INFO] Parameter: confluenceDataVersion, Value: 6.14.0
[INFO] Parameter: bitbucketVersion, Value: 5.16.0
[INFO] Parameter: jiraVersion, Value: 7.13.0
[INFO] Parameter: bitbucketDataVersion, Value: 5.16.0
[WARNING] CP Don't override file /Users/sbehnke/Projects/test-artifact/src/main/resources/META-INF
[WARNING] CP Don't override file /Users/sbehnke/Projects/test-artifact/src/main/resources/META-INF/spring
[INFO] Project created from Archetype in dir: /Users/sbehnke/Projects/test-artifact
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 15.687 s
[INFO] Finished at: 2019-12-18T13:31:49-08:00
[INFO] ------------------------------------------------------------------------
sbehnke-mbp15:Projects sbehnke$ cd test-artifact/

I modified my pom.xml file:

vim pom.xml 
<plugin>
                <groupId>com.atlassian.maven.plugins</groupId>
                <artifactId>refapp-maven-plugin</artifactId>
                <version>${amps.version}</version>
                <extensions>true</extensions>
                <configuration>
                    <productVersion>${refapp.version}</productVersion>
                    <enableQuickReload>true</enableQuickReload>
                    <jvmArgs>-Xms2048m -Xmx2048m</jvmArgs>

Tomcat was configured with these settings, unless I am missing something I think this works fine:

[INFO] [talledLocalContainer] Dec 18, 2019 1:33:50 PM org.apache.catalina.startup.VersionLoggerListener log
[INFO] [talledLocalContainer] INFO: Command line argument: -Xms2048m
[INFO] [talledLocalContainer] Dec 18, 2019 1:33:50 PM org.apache.catalina.startup.VersionLoggerListener log
[INFO] [talledLocalContainer] INFO: Command line argument: -Xmx2048m

I am referring to the atlas-integration-test’s “refapp” - they default its context path to /refapp, so that’s what I called it. It’s the one that gets spun up on port 5990 by default.

When using atlas-run|debug, it gets passed to the dev Jira (port 2990) just fine.