You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GC.Collect() is a method, often unecessary that could affect performances. It will trigger a blocking operation that will analyze every objects that are in memory in order to execute the cleanup.
When can it be ignored ?
If the specified generation is 0, in this case it should be harmless
If a special event in your program caused a lot of long-lived objects to die
Hi all, on @Djoums advice, I suggest to add this rule.
Sonar already implements this rule, see it here : https://cloud-ci.sgs.com/sonar/coding_rules?open=csharpsquid%3AS1215&rule_key=csharpsquid%3AS1215
Category : Performance
Severity : Warning
Why is this an issue
GC.Collect() is a method, often unecessary that could affect performances. It will trigger a blocking operation that will analyze every objects that are in memory in order to execute the cleanup.
When can it be ignored ?
Non-compliant Code Example
Compliant Code Example
The text was updated successfully, but these errors were encountered: