-
Notifications
You must be signed in to change notification settings - Fork 2
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
Any error during analysis will cause memory leak #15
Comments
@SuicaLondon |
@hyiso Thank you fro reply. I have already checked this issue and tried before I opened this issue. In conclusion.
I guess it may has multiple issues are happening at the same time. One is the pending executable is never ended, another is some how the memory does not released. |
@SuicaLondon |
How is this problem solved now?It's easily crashed after commit over 100 files and it open 352 threads at one time——which cost 8020.2MB memory 😅 |
A temporary solution: When there are multiple file changes that need to be committed, commit no more than 10 files at a time, and then convert them to one commit by git amend |
As @BTMuli suggested, the problem of memory cost is caused by the
Then, we can implement a thread pool to manage that. If the project owner think it is okay, I can implement that and test it on my project and create an mr. |
This ticket is relative to this issue but it has different behaviour and causes memory leak.
I am currently using a MacBook Pro 14 inch with M1 Pro with 16G Ram, OS version is 14.1
If the analysis process encounters an error, such as the one mentioned, there may not be an apparent issue. However, problems may arise when committing a large number of files simultaneously, like during a 300-file refactoring. In such cases, the process might exhaust the computer's memory and continually create new Dart processes in the background. Upon investigating the code, I observed that the process fails to terminate in the event of an error [will not kill the process](https://github.com/hyiso/lint_staged/blob/main/lib/s
rc/run.dart).
What I suggest is that, add the kill process code on error handling as the Flutter does not have feature of
Future.allSettled()
As I'm uncertain about the business logic, this may not work as the message does not update. So it seems the issue could be attributed to the process not terminating properly, causing it to stay in the memory forever.
The text was updated successfully, but these errors were encountered: