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

Memory Optimization on Schema #6290

Merged
merged 3 commits into from
Jun 25, 2023
Merged

Conversation

PascalSenn
Copy link
Member

@PascalSenn PascalSenn commented Jun 24, 2023

Previously, the method OnAfterInitialize in the type discovery context held onto its configuration delegate even after initialization. As a result, all instances used during this initialization phase remained in memory until the schema was phased out, leading to unnecessary static memory allocation.

With this change, we now explicitly clear the _configure delegate after the initialization phase in the OnAfterInitialize method. The clearing is performed at this stage because any subsequent calls to Initialize would throw an exception, indicating that the schema has already been initialized and the configuration delegate is no longer needed.

@sonarcloud
Copy link

sonarcloud bot commented Jun 24, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@michaelstaib michaelstaib merged commit e11401c into main Jun 25, 2023
@michaelstaib michaelstaib deleted the pse/fix-memory-leak-in-schema branch June 25, 2023 18:51
This was referenced Sep 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants