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

Out of Memory for build runner #197

Open
tsherdiwala opened this issue May 25, 2024 · 4 comments
Open

Out of Memory for build runner #197

tsherdiwala opened this issue May 25, 2024 · 4 comments
Labels
investigate Needs investigation

Comments

@tsherdiwala
Copy link

tsherdiwala commented May 25, 2024

When running dart_mappable for across the project generation - the memory footprint grows extensively and leading to almost 30GB of usage.

Have made sure that only the dart_mappable_builder builder is initiated by disabling the other builders using build.yaml file.

Upon running the debugger tools able to see that the memory is being hogged and not being garbage collect with package:analyzer/src/dart/element/element.dart/ParameterElementImpl being the one holding the highest memory

image
@schultek
Copy link
Owner

I will try to investigate. What would help if you have a reproducible setup that causes this.

@tsherdiwala
Copy link
Author

I can try to create a subset of the things which I am working on as won't be able to share the actual code base. However the point to highlight is that there are many classes / files which rely extensively on it. On a smaller usecase it works however probably when there is a large number of generations to take place that were the issue happens.

@schultek
Copy link
Owner

I wonder if thats just a linear scaling problem (more classes to more memory) or an exponentially scaling problem because of some bug. But the high numbers point to some memory leak.

@tsherdiwala
Copy link
Author

I have as of now found a workaround by limiting the files using build.yaml and selectively enabling it.

eg:

targets:
  $default:
    builders:
      build_resolvers:transitive_digests:
        enabled: false
      reflectable:
        enabled: false
      dart_mappable_builder:
        enabled: true
        generate_for:
          include:
#            - lib/**analytics.dart
#            - lib/**ViewModel.dart
#            - lib/**app.dart
#            - lib/**legacy.dart
#            - lib/**notifications.dart
#            - lib/**ad.dart
#            - lib/**ViewModelProps.dart
#            - lib/**constants.dart
#            - lib/**ViewModelState.dart
            - lib/**serialization.dart
#          exclude:
#            - lib/**.*.dart
      freezed:
        enabled: true

@schultek schultek added the investigate Needs investigation label Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigate Needs investigation
Projects
None yet
Development

No branches or pull requests

2 participants