GC.ForceCollectLargeObjectHeap
Today there isn't any way to force releasing of Large Object Heap allocated memory, a matter which causes fragments in the Handled memory heap.
Thank you all for voting on this suggestion. We are unable to fully understand the suggestion in its current form. Please provide more details if this is something that you would like to see us consider in the future.
Best Wishes
Deonhe – MSFT .NET Framework Team
2 comments
-
Vasiliy Fofanov
commented
We need mehod in GC like CollectLOH - Large Object Heap
In my case I use huge lists(more >80 000 items) in a short period and after job is done I need release them from memory
So, I need after job is done call GC.CollectLOH(). And, if it possible, GC.LOHLastModified property for control useless runs of GC.CollectLOH()
Example:
var _startTime = DateTime.Now;
//do work with some huge collections
if (GC.LOHLastModified >_startTime)
{
GC.CollectLOH();
} -
Abhishek Mondal
commented
Hello Shai,
This is Abhishek Mondal from the CLR team and I am the PM on Garbage Collection and Core OS. I wanted to chat more with you on your scenario, which is not quie clear from the sugesstion that you have posted. Are you asking for a way to compact the large object heap ? Also what exactly do you mean by "Handled memory heap" ?
Feel free to get in touch with me at abhishek.mondal@microsoft.com and we can discuss this further.
Thanks,
Abhishek Mondal
Program Manager
Common Language Runtime.