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

Default Eclipse JVM should not have -XmX parameter #1463

Closed
grandinj opened this issue Oct 24, 2023 · 19 comments · Fixed by #1471 or #1483
Closed

Default Eclipse JVM should not have -XmX parameter #1463

grandinj opened this issue Oct 24, 2023 · 19 comments · Fixed by #1471 or #1483
Assignees
Milestone

Comments

@grandinj
Copy link

I have noticed that recent installers, when using the default supplied VM to run Eclipse, has an -XmX parameter.

This leads to an extremely frustrating experience with large projects. I suddenly found my debugger doing all sorts of very weird things, which led to a loooooooong goose chase before I found the cause.

Either
(a) the platform needs some indication that it is running into memory issues
(b) just leave that parameter out, in which case the VM will grow to use available memory on the machine.

(I vote for option b)

Thanks.

@iloveeclipse iloveeclipse transferred this issue from eclipse-platform/eclipse.platform.ui Oct 24, 2023
@iloveeclipse
Copy link
Member

I believe option (b) makes sense. On "usual" working environments today we have way more RAM as before and JVM would "automatically" reserve more than default 2GB (SDK sets -Xms256m -Xmx2048m in the sdk.product).

The only problem I see "smaller" configurations like Jenkins platform builds that usually suffer from too strict resources limits and where JVM would set smaller heap.
But there we could set VM heap limits in Jenkins files.

@merks
Copy link
Contributor

merks commented Oct 24, 2023

FYI, this issue was discussed here as well:

eclipse-packaging/packages#37

Most folks are using one of the EPP packages, so what the Platform does has much narrower impact than what EPP does...

@jonahgraham
Copy link
Contributor

As I mentioned in eclipse-packaging/packages#37 (comment) the EPP normally aims to follow where the Platform/SDK leads. This has been the case because we used to inherit the Platform settings, that was changed recently(ish) which gives us the option to drop the xmx from EPP.

In this case perhaps EPP should lead and platform/SDK can follow along later?

@iloveeclipse
Copy link
Member

In this case perhaps EPP should lead and platform/SDK can follow along later?

Or we can just try to do this in SDK and see if something breaks on Jenkins/official build & fix Jenkins files etc in case we still need Xmx option. I will push a PR in a moment.

iloveeclipse added a commit to iloveeclipse/eclipse.platform.releng.aggregator that referenced this issue Oct 24, 2023
@iloveeclipse
Copy link
Member

Or we can just try to do this in SDK and see if something breaks on Jenkins/official build & fix Jenkins files etc in case we still need Xmx option.

Any objections? => #1471

@iloveeclipse
Copy link
Member

So far there were no regressions in the SDK tests, we will see if some Jenkins jobs would fail.

The default SDK eclipse.ini looks like this now (Linux build):

-startup
plugins/org.eclipse.equinox.launcher_1.6.600.v20231012-1237.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.2.800.v20231003-1442
--launcher.defaultAction
openFile
--launcher.appendVmargs
-vmargs
-Dosgi.requiredJavaVersion=17
-Dosgi.dataAreaRequiresExplicitInit=true
-Dorg.eclipse.swt.graphics.Resource.reportNonDisposed=true
--add-modules=ALL-SYSTEM
-Dorg.slf4j.simpleLogger.defaultLogLevel=off
-Djava.security.manager=allow

@iloveeclipse iloveeclipse self-assigned this Oct 25, 2023
@iloveeclipse iloveeclipse added this to the 4.30 M3 milestone Oct 25, 2023
@iloveeclipse
Copy link
Member

I see a first OOM in the Jenkins test:
https://ci.eclipse.org/platform/job/eclipse.platform/job/PR-731/5/console

@laeubi : I can't understand what maved output says and in which task it had OOM. It also looks like there are multiple tasks running in parallel (see org.eclipse.core.tests.resources test output mixed with all other entries).

There is also one maven error [ERROR] MavenReportException: Error while generating Javadoc.

Can you help understand following:

  1. Which Eclipse/tycho task has reported [ERROR] java.lang.OutOfMemoryError: Java heap space? Is it org.eclipse.core.tests.resources test? Something else?
  2. How to configure that one to use more heap (as it looks like Jenkins is very low on resources)? If that is about test execution, I assume we have to add <argLine>-Xmx2G to the pom.xml file in question. But to which one (see first question)?

@iloveeclipse iloveeclipse reopened this Oct 25, 2023
@laeubi
Copy link
Contributor

laeubi commented Oct 25, 2023

It also looks like there are multiple tasks running in parallel

Platform build is executed in parallel

Which Eclipse/tycho task has reported [ERROR] java.lang.OutOfMemoryError: Java heap space? Is it org.eclipse.core.tests.resources test? Something else?

You can see the limits here: https://ci.eclipse.org/platform/job/eclipse.platform/job/PR-731/5/consoleText

  resources:
      limits:
        cpu: "2000m"
        memory: "4096Mi"
      requests:
        cpu: "1000m"
        memory: "4096Mi"

but I don't really understand how eclipse.ini relates to Jenkins build execution... so if we know how/if this makes a difference there might be a way to further configure this, e.g. for maven one would use .mvn/jvm.config but tests are using different setting depending on they are forked or not...

@iloveeclipse
Copy link
Member

but I don't really understand how eclipse.ini relates to Jenkins build execution...

If the tycho starts SDK product during tests, it uses eclipse.ini we've changed in #1471.

I honestly don't know what tycho does to construct the test application and if that inherits eclipse.ini coming from the SDK product. If tycho based test instance inherits that file, it also doesn't use -XmX2g defaults anymore and probably uses only 1GB heap (1/4 from machine RAM on Jenkins).

But still open question: any clue which task has reported OOM?

@laeubi
Copy link
Contributor

laeubi commented Oct 25, 2023

But still open question: any clue which task has reported OOM?

infocenter-product 1.0.0-SNAPSHOT .................. FAILURE [ 7.372 s]

is the module failing the build, but this might only be a side-effect of the JVM itsel running out of memmory, thats why I said, I can't see that a PROCESS (that can read eclipse.ini) is failing, the JVM that running the BUILD seems going OOM...

@iloveeclipse
Copy link
Member

What I mean is something like eclipse-platform/eclipse.platform#767.
But assuming all tests has to be adopted, is there a more elegant solution (as adding this option in every pom)?

@laeubi
Copy link
Contributor

laeubi commented Oct 25, 2023

If you want to share things in common, it is best placed here in pluginManagement section of the build:
https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/eclipse-platform-parent/pom.xml

@iloveeclipse
Copy link
Member

infocenter-product 1.0.0-SNAPSHOT .................. FAILURE

I don't see which / where is this FAILURE reported in the log (above the table)? The last relevant entry I see is an INFO
10:16:48.454 [INFO] --- tycho-p2-repository:4.0.4-SNAPSHOT:assemble-repository (default-assemble-repository) @ infocenter-product

@iloveeclipse
Copy link
Member

If you want to share things in common, it is best placed here in pluginManagement section of the build: https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/blob/master/eclipse-platform-parent/pom.xml

So this line has to be adopted to have -Xmx option:

<argLine>${surefire.testArgLine} ${surefire.platformSystemProperties} ${surefire.systemProperties} ${surefire.moduleProperties}</argLine>

iloveeclipse added a commit to iloveeclipse/eclipse.platform.releng.aggregator that referenced this issue Oct 25, 2023
`-Xmx2g` is needed for Jenkins where RAM is low.

SDK doesn't specify `-Xmx` anymore, see
eclipse-platform#1463
@iloveeclipse iloveeclipse removed their assignment Oct 25, 2023
@iloveeclipse iloveeclipse removed this from the 4.30 M3 milestone Oct 25, 2023
@iloveeclipse
Copy link
Member

iloveeclipse commented Oct 25, 2023

Change is reverted, due possibility that is causes OOM in Jenkins builds.
If someone sees OOM's an platform jenkins builds after next IBuild, please comment here.

@iloveeclipse
Copy link
Member

iloveeclipse commented Oct 27, 2023

OK, looks like we see OOM's elsewhere without this patch, see eclipse-platform/eclipse.platform#764.

So I plan to re-submit #1471 as soon as we have solution for more RAM on Jenkins, see https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/issues/3885 .

See #1483

iloveeclipse added a commit to iloveeclipse/eclipse.platform.releng.aggregator that referenced this issue Oct 27, 2023
@iloveeclipse iloveeclipse added this to the 4.30 M3 milestone Oct 27, 2023
@iloveeclipse iloveeclipse self-assigned this Oct 27, 2023
@iloveeclipse
Copy link
Member

eclipse-platform/eclipse.platform#784 provided now 8 GB RAM for Platform builds on Jenkins, let see if that helped or not.

@jonahgraham
Copy link
Contributor

Has there been any negative effects of this? EPP will make this same change too unless someone raises a concern inhttps://github.com/eclipse-packaging/packages/issues/37

@iloveeclipse
Copy link
Member

Has there been any negative effects of this?

Only for poor VM (Jenkins) instances with <= 4GB RAM.

For PC's/VM's with >=8 GB everything should be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment