Bug 550546 - Java heap space error - eclipse exits
Summary: Java heap space error - eclipse exits
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: cross-project
Depends on:
Blocks:
 
Reported: 2019-08-28 18:20 EDT by Patrik Suzzi CLA
Modified: 2021-04-19 13:25 EDT (History)
1 user (show)

See Also:


Attachments
Manifestation of the problem (58.72 KB, image/png)
2019-08-28 18:20 EDT, Patrik Suzzi CLA
no flags Details
Error log where you can see the full stacktrace and sequence of error events (1002.44 KB, application/octet-stream)
2019-08-28 18:21 EDT, Patrik Suzzi CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Patrik Suzzi CLA 2019-08-28 18:20:23 EDT
Created attachment 279703 [details]
Manifestation of the problem

Hi, I am using Spring Tools 4 on mac os. 

Every time I try to create a project using a maven archetype, the Eclipse IDE freezes and crashes. 

Here are the relevant bits of the exception

java.lang.OutOfMemoryError: Java heap space
	at java.base/java.lang.Integer.toString(Integer.java:440)
	at org.eclipse.wst.jsdt.internal.core.search.processing.JobManager$1ProgressJob.run(JobManager.java:342)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Here is the build information:

Spring Tool Suite 4 
Version: 4.3.2.RELEASE
Build Id: 201908130627
OS: Mac OS X, v.10.14.6, x86_64 / cocoa
Java version: 10.0.1

Here is the maven version
Eclipse.org - m2e	Maven Integration for Eclipse	1.12.0.20190628-1134	org.eclipse.m2e.feature
Comment 1 Patrik Suzzi CLA 2019-08-28 18:21:42 EDT
Created attachment 279704 [details]
Error log where you can see the full stacktrace and sequence of error events
Comment 2 Patrik Suzzi CLA 2019-08-28 18:23:52 EDT
Marked as critical as it shuts down Eclipse. 

Perhaps I should mark it as a blocker because it totally prevents the creation of a maven project by typing the archetype.
Comment 3 Patrik Suzzi CLA 2019-08-28 19:35:37 EDT
This happens also in Eclipse Ide JEE. 
Cleaning maven cache does not solve the issue.
There are no other ways to use the IDE to generate a maven project with archetype. The feature does not work. Marking as blocker.
Comment 4 Fred Bricon CLA 2019-08-29 04:34:15 EDT
Either you can increase the heap size in eclipse.ini, see #1, or disable the Nexus indexer in Preferences > Maven > Archetypes and add a new click the "Add Remote Catalog" button, add “http://repo1.maven.org/maven2/archetype-catalog.xml” to the catalog file field, and some custom description. Go back to the wizard and try again (will take some time to load the thousands of archetypes in there). 

#1 https://wiki.eclipse.org/FAQ_How_do_I_increase_the_heap_size_available_to_Eclipse%3F
Comment 5 Patrik Suzzi CLA 2019-09-02 05:07:46 EDT
(In reply to Fred Bricon from comment #4)
> Either you can increase the heap size in eclipse.ini, see #1, or disable the
> Nexus indexer 

Fred, thanks. It used to fail with Xmx1024m, and now it works with Xmx2048m.
So, there is a workaround, and I downgraded the importance to normal. 


I'm now thinking to mark the bug as solved. However, my point is: if you download Eclipse JEE for mac the default is Xmx1024m. Many people will be using maven, and perhaps enabling the Nexus indexer. Then, all those who don't increase the heap size will get an error for which there is no hint to the solution. (a message like: "try increasing your heap size" will help)


I think there are three ways of fixing this: 
1. increase the default heap space
2. catch the heap space exception in the specific case of maven catalog search and suggest the user increase the heap space. 
3. improve the algorithm/DS for loading the catalog. Do we really need 1GB heap for the catalog?

Probably several people will be unhappy with solution 1. Plus, I guess solution 2. is not a best practice. Hence I think the viable option is option 3, which refers to bug 478647.

Bottom line: if you think solution 2 can be useful, then leave this bug open, and someone will work on this. Otherwise, I can close this bug and make it a duplicate of bug 478647
Comment 6 Fred Bricon CLA 2019-09-02 05:33:13 EDT
I'm inclined to disable the Nexus indexer for the catalog by default, and add the remote repo.maven.org catalog OOTB, it'll be the easiest solution.
Adding a warning about the memory requirements would also be good.
Comment 7 Mickael Istria CLA 2021-03-30 05:29:37 EDT
Eclipse m2e is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse-m2e/m2e-core/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Eclipse Platform and m2e release
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse-m2e/m2e-core/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the m2e component for m2e will be made read-only.
Comment 8 Mickael Istria CLA 2021-03-30 05:32:43 EDT
Eclipse m2e is moving away from this bugs.eclipse.org issue tracker to https://github.com/eclipse-m2e/m2e-core/issues/ instead. If this issue is relevant to you, your action is required.
0. Verify this issue is still happening with latest Eclipse Platform and m2e release
  if issue has disappeared, please change status of this issue to "CLOSED WORKFORME" with some details about your testing environment and how you did verify the issue; and you're done
  if issue is still present when latest release:
* Create a new issue at https://github.com/eclipse-m2e/m2e-core/issues/
  ** Use as title in GitHub the title of this Bugzilla ticket (may include the bug number or not, at your own convenience)
  ** In the GitHub description, start with a link to this bugzilla ticket
  ** Optionally add new content to the description if it can helps towards resolution
  ** Submit GitHub issue
* Update bugzilla ticket
  ** Add to "See also" property (up right column) the link to the newly created GitHub issue
  ** Add a comment "Migrated to <link-to-newly-created-GitHub-issue>"
  ** Set status as CLOSED MOVED
  ** Submit

All issues that remain open will be automatically closed next week or so. Then the m2e component for m2e will be made read-only.
Comment 9 Denis Roy CLA 2021-04-19 13:25:56 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/