Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISPN-8478 Reduce build memory usage #5528

Merged
merged 1 commit into from Nov 8, 2017

Conversation

danberindei
Copy link
Member

@danberindei danberindei commented Oct 20, 2017

https://issues.jboss.org/browse/ISPN-8478

Since I first opened the PR, the ANSI escape codes in test suite output which were causing the OSGi tests OOME have been reverted.

So I've changed the target of the PR to get the build running on the new agents that only have 4GB of RAM.

@@ -332,6 +332,7 @@ public static Option featurePaxUrlWrap() throws Exception {
public static Option commonOptions() throws Exception {
return composite(karafContainer(),
vmOptions("-Djava.net.preferIPv4Stack=true", "-Djgroups.bind_addr=127.0.0.1"),
vmOptions("-Xmx1G", "-XX:-PrintGCDetails", "-XX:-PrintGCTimeStamps"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmmm it looks a bit weird - we set Xmx in integrationtests/osgi/pom.xml and here we use 1GB. Could you please tell me why? And shouldn't this be parametrized (e.g. taken from pom)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are 3 JVMs running:

  1. The Maven JVM - uses heap size from $MAVEN_OPTS or 1/4 or RAM.
  2. The Surefire fork - uses heap size from forkJvmArgs (2G in parent/pom.xml), $MAVEN_FORK_OPTS, or 1/4 of RAM if $MAVEN_FORK_OPTS is non-empty and doesn't have -Xmx.
  3. The Karaf process - 1/4 of RAM.

In this PR, I'm experimenting with the heap size of all 3 JVMs. I could use the same heap size for VMs 2 and 3, but I don't think it's ok to give that much memory to the Surefire fork when all it does is start the Karaf process.

@gustavocoding
Copy link

@danberindei In my env it appears the the Maven Launcher process itself crashed; the surefire fork exited normally, but the build exited with
[ERROR] Java heap space -> [Help 1].

I got no dump since only the fork has the dump flags, I am re-running adding them to MAVEN_OPTS.

I got 32GB of ram, in theory the lancher should have about 8Gb for itself...

@gustavocoding
Copy link

@danberindei In my env the maven launcher always crashes in the JCache TCK runner module, it allocated > 6Gb ram

@gustavocoding
Copy link

After looking at the dump (of the maven launcher), there's a Thread object with lots of crap in with:

Here's where it explodes:

main <--- OutOfMemoryError happened in this thread State: RUNNABLE tid: 1
  java.lang.OutOfMemoryError.<init>() OutOfMemoryError.java:48
  java.util.Arrays.copyOf(char[], int) Arrays.java:3332
  java.lang.AbstractStringBuilder.ensureCapacityInternal(int) AbstractStringBuilder.java:124
  java.lang.AbstractStringBuilder.append(String) AbstractStringBuilder.java:448
  java.lang.StringBuilder.append(String) StringBuilder.java:136
   org.apache.maven.plugin.surefire.booterclient.output.MultipleFailureException.getLocalizedMessage() MultipleFailureException.java:52
  org.apache.maven.plugin.surefire.booterclient.ForkStarter$CloseableCloser.run() ForkStarter.java:200
  org.apache.maven.surefire.shade.org.apache.maven.shared.utils.cli.CommandLineUtils$1.call() CommandLineUtils.java:282
  org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(Object, KeyValueSource, ForkClient, SurefireProperties, int, AbstractForkInputStream, boolean) ForkStarter.java:626
  org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(Object, KeyValueSource, ForkClient, SurefireProperties, AbstractForkInputStream, boolean) ForkStarter.java:533
  org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(SurefireProperties, Map) ForkStarter.java:279

@danberindei You mentioned we are messing up with surefire fork I/O, should we stop doing that maybe? :)

@danberindei
Copy link
Member Author

@gustavonalle please revert Tristan's colourizing patch, #5520, and try again.

@gustavocoding
Copy link

Reverting #5520 fixes the leak

@danberindei danberindei force-pushed the t_osgi_OOME branch 4 times, most recently from ab053d6 to 3076ad1 Compare November 2, 2017 11:36
@danberindei danberindei changed the title Run OSGi integration tests with a fixed heap size ISPN-8478 Reduce build memory usage Nov 2, 2017
@danberindei danberindei force-pushed the t_osgi_OOME branch 3 times, most recently from ac42f34 to 031e37d Compare November 6, 2017 10:03
@gustavocoding
Copy link

@danberindei Could you rebase?

@danberindei
Copy link
Member Author

Updated!

@gustavocoding
Copy link

gustavocoding commented Nov 8, 2017

Was hoping for an improvement in the build stability, but the build crashed the same :)

@gustavocoding
Copy link

Re-triggering it

@danberindei
Copy link
Member Author

danberindei commented Nov 8, 2017

@gustavonalle The timeout in as-lucene-directory is unrelated, it looks like an issue with the H2 driver and/or WildFly.

Also the last build appears successful, only the commit status update failed for some reason.

@gustavocoding gustavocoding merged commit 65faa39 into infinispan:master Nov 8, 2017
@gustavocoding
Copy link

Merged, thanks @danberindei !

@danberindei
Copy link
Member Author

@gustavonalle Looks like 700MB of heap is not always enough for the infinispan-wildfly-modules build after all:

http://ci.infinispan.org/job/Infinispan/job/PR-5580/1/console

I pushed a commit to make the heap 800MB directly to master.

@danberindei danberindei deleted the t_osgi_OOME branch April 10, 2020 08:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants