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

Projects leak in ExternalIndexableSetContributor.CACHE #553

Closed
2 of 3 tasks
ibessonov opened this issue Jul 6, 2018 · 5 comments
Closed
2 of 3 tasks

Projects leak in ExternalIndexableSetContributor.CACHE #553

ibessonov opened this issue Jul 6, 2018 · 5 comments

Comments

@ibessonov
Copy link

ibessonov commented Jul 6, 2018

Prerequisites

  • Plugin is in the latest version
  • Issue was not reported yet
  • Stack trace (if provided) contains mobi.hsz.idea.gitignore package name

Description

ExternalIndexableSetContributor.CACHE contains disposed projects in memory dump. This causes memory leaks and increases GC time.

Problem was discovered while inspecting this issue: https://youtrack.jetbrains.com/issue/IDEA-192493

@hsz
Copy link
Member

hsz commented Jul 16, 2018

@ibessonov Thank you for creating this issue. I have no access to the linked ticket:

You have no permissions to view this page

Anyway, I've reviewed the code and ExternalIndexableSetContributor.invalidateCache(Project) is invoked always when the IgnoreManager project component is disposed (which is disposed when project is disposed).

@ibessonov
Copy link
Author

Hi @hsz, I see invalidation in IgnoreManager, but at the same time I see disposed projects in CACHE map in ExternalIndexableSetContributor. I'm confused to be honest. You can investigate this dump:
ftp://ftp.intellij.net/.uploads/damien-sorel-dump-and-logs-2018-06-29.zip, you'll find disposed IgnoreManager objects with disposed projects but valid cache.

Can it be that ExternalIndexableSetContributor#getAdditionalFiles is invoked after disposal? It would create empty values in CACHE.

@hsz
Copy link
Member

hsz commented Jul 18, 2018

@ibessonov File is not available via the provided URL.

@hsz
Copy link
Member

hsz commented Jul 19, 2018

@ibessonov I have checked the code again and it's almost impossible to have disposed projects in this map. Maybe there is some border case or issue in IDE SDK - who knows.
I did the additional check on project open/close - so if there will be new project opened or previous closed - it'll iterate through CACHE and remove all disposed entries from map.

@ibessonov
Copy link
Author

Thank you!
Sorry that I didn't provide valid dump, I completely forgot that "ftp.intellij.net" is a write-only service for anonymous users. I wasn't able to reproduce this issue myself, it's clearly some border case. It probably occurs under high loads or in some rare data races.

@hsz hsz added this to the v2.6.3 milestone Jul 20, 2018
@hsz hsz closed this as completed Sep 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants