© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•4y ago•
25 replies
hugeman

❔ Release mode garbage collection is much longer than debug mode

I built a WPF app, and to test the lag, i'm just selecting a ListBoxItem and moving my mouse up and down (which generates lots of garbage due to WPF).
When i build my app in debug mode and run it in VS, the garbage collection is almost instant and there's practically no spikes or stoppages when constantly changing the selected item. But when i build it in release mode, every half a second there's a spike for about 600ms or so. What could be causing this? (I added a small progress bar to show the memory usage, and the usage drops after the large spikes in Release mode, but in debug mode it's like it just randomly drops)
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Release slower than Debug
C#CC# / help
2y ago
Garbage Collection Questions
C#CC# / help
3y ago
❔ Garbage collection question
C#CC# / help
3y ago
❔ What is the purpose of `ModelBindingContext.Model`, `ModelName`, and `ModelBinderAttribute.Name`?
C#CC# / help
3y ago