Alternative Memory Management Strategy for .NET #73991
-
.NET has a very polished GC and it is working quite well, but when you are working with data-intensive applications that are making a lot of allocations as result you will have a lot of GC cycles that is affecting in overall performance and memory continues to grow. Recently I found this article |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
@dotnet/gc |
Beta Was this translation helpful? Give feedback.
-
P.S. Allocating 1000 times and freeing a 1000 times is not a memory leak... |
Beta Was this translation helpful? Give feedback.
-
We thought the Snowflake research project was a very worthwhile experiment and I worked with MSR to explore this idea. The project could show gains for specific best case scenarios but unfortunately the attempt to extend that to good results across a broader set of scenarios important to our .NET developers was unsuccessful. This was not an unusual outcome. Many experiments start out promising but may not pan out. It's possible we'll return to this idea in the future and try to resolve more issues but currently we think there are other features that would bring more value. |
Beta Was this translation helpful? Give feedback.
-
.NET should allow manual memory allocation and deallocation. There are a lot of ways to do that, like having manually controllable pages or reference counting like in Swift, etc. But the main point is why we need that, as GC is very good but not perfect and it is slow (when you are working on desktop and GC decades to freezes rendering thread as well and your app is not responsive any more, enabling server mode doesn't help here). You also can have a lot of cases when GC not cleaning memory (no leak) and continue allocations and you don't have control over it. Application users who don't know about programming complaint that memory usage is very big but we just telling them wait some time and it automatically decries. Why developers shouldn't be allowed to immediately release that as they understanding what they are doing?! Sometimes developers creating multiply child processes to do some work and fully cleanup memory this is more common on desktop development but it is too complex and requires serialization and deserialization. Developers need that freedom and they are smart enough to correctly use it! |
Beta Was this translation helpful? Give feedback.
-
either there's an absolute improvement or there isn't, because then we are in the territory of benchmarking and blackbox programming where the factor of performance is no longer the brilliance but leaving it to chances and luck and all the AI banaza |
Beta Was this translation helpful? Give feedback.
We thought the Snowflake research project was a very worthwhile experiment and I worked with MSR to explore this idea. The project could show gains for specific best case scenarios but unfortunately the attempt to extend that to good results across a broader set of scenarios important to our .NET developers was unsuccessful. This was not an unusual outcome. Many experiments start out promising but may not pan out. It's possible we'll return to this idea in the future and try to resolve more issues but currently we think there are other features that would bring more value.