Bug 552281 - JavaPartitionerManager leaks memory leading to OOM
Summary: JavaPartitionerManager leaks memory leading to OOM
Status: VERIFIED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 4.14   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: 4.14 M3   Edit
Assignee: Kalyan Prasad Tatavarthi CLA
QA Contact:
URL:
Whiteboard:
Keywords: regression
Depends on:
Blocks: 549473
  Show dependency tree
 
Reported: 2019-10-21 11:19 EDT by Andrew Niefer CLA
Modified: 2019-11-20 04:02 EST (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Niefer CLA 2019-10-21 11:19:08 EDT
I20191007-1800
My eclipse crashed with an OutOfMemoryException, analyzing the phd file shows JavaPartionerManager.fPartionerSet retaining 1714 entries of FastJavaPartitioner  totalling nearly 800MB.
Comment 1 Andrey Loskutov CLA 2019-10-31 05:50:59 EDT
(In reply to Andrew Niefer from comment #0)
> I20191007-1800
> My eclipse crashed with an OutOfMemoryException, analyzing the phd file
> shows JavaPartionerManager.fPartionerSet retaining 1714 entries of
> FastJavaPartitioner  totalling nearly 800MB.

Which Xmx limit is set for the JVM? Please provide steps to reproduce.
Comment 2 Andrey Loskutov CLA 2019-10-31 06:15:37 EDT
(In reply to Andrew Niefer from comment #0)
> JavaPartionerManager.fPartionerSet 

typo:

JavaPartitionerManager.fPartionerSet

The code is coming from bug 549473. I see that fPartitionerSet management is  broken and the problem appears even if no Java 13+ code/JVM is used.

fEditorPartitionerMap is never adding editors (which is probably good anyway, that would be another candidate for OOM), so no partitioner is found in clearEditorInfo.

This is a severe regression.
Comment 3 Eclipse Genie CLA 2019-10-31 06:20:47 EDT
New Gerrit change created: https://git.eclipse.org/r/151829
Comment 5 Noopur Gupta CLA 2019-10-31 10:03:22 EDT
Thanks for looking into it, Andrey.
Comment 6 Kalyan Prasad Tatavarthi CLA 2019-10-31 10:55:49 EDT
Reopening the bug as fPartitionerSet as well as fEditorPartitionerMap are not required for the document to be updated due to changes done to project preferences because the preference change is handled by the function FastJavaPartitioner::computePartitioning function. The new patch set will remove the two fields fPartitionerSet as well as fEditorPartitionerMap from JavaPartitionerManager.
Comment 7 Eclipse Genie CLA 2019-10-31 10:57:53 EDT
New Gerrit change created: https://git.eclipse.org/r/151842
Comment 9 Andrey Loskutov CLA 2019-10-31 12:14:25 EDT
(In reply to Kalyan Prasad Tatavarthi from comment #6)
> The new patch set will
> remove the two fields fPartitionerSet as well as fEditorPartitionerMap from
> JavaPartitionerManager.

This is even better! Thanks.
Comment 10 Andrew Niefer CLA 2019-11-01 15:48:51 EDT
(In reply to Andrey Loskutov from comment #1)
> Which Xmx limit is set for the JVM? Please provide steps to reproduce.

It looks like it no longer really matters, but I run with -Xmx1624m.  I didn't have steps beyond run eclipse for a few days (or a week) of java development without restarting.
Comment 11 Kalyan Prasad Tatavarthi CLA 2019-11-20 04:02:20 EST
Verified in the code for build I20191119-2200