Default strategy for large object heap compaction











up vote
1
down vote

favorite












What is, by default, the strategy used by the .NET framework to compact the large object heap?




  • never compacted

  • compacted after a while (not as aggressively as generational heap)


What holds? If "after a while", are there a few details about "how long" or "when"?



(I'm interested in .NET framework versions higher than 4.5)










share|improve this question
























  • Which texts? It helps to know what we are reacting to.
    – Henk Holterman
    Nov 21 at 12:57















up vote
1
down vote

favorite












What is, by default, the strategy used by the .NET framework to compact the large object heap?




  • never compacted

  • compacted after a while (not as aggressively as generational heap)


What holds? If "after a while", are there a few details about "how long" or "when"?



(I'm interested in .NET framework versions higher than 4.5)










share|improve this question
























  • Which texts? It helps to know what we are reacting to.
    – Henk Holterman
    Nov 21 at 12:57













up vote
1
down vote

favorite









up vote
1
down vote

favorite











What is, by default, the strategy used by the .NET framework to compact the large object heap?




  • never compacted

  • compacted after a while (not as aggressively as generational heap)


What holds? If "after a while", are there a few details about "how long" or "when"?



(I'm interested in .NET framework versions higher than 4.5)










share|improve this question















What is, by default, the strategy used by the .NET framework to compact the large object heap?




  • never compacted

  • compacted after a while (not as aggressively as generational heap)


What holds? If "after a while", are there a few details about "how long" or "when"?



(I'm interested in .NET framework versions higher than 4.5)







.net garbage-collection large-object-heap






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 22 at 19:52

























asked Nov 21 at 12:41









Benoit Sanchez

292113




292113












  • Which texts? It helps to know what we are reacting to.
    – Henk Holterman
    Nov 21 at 12:57


















  • Which texts? It helps to know what we are reacting to.
    – Henk Holterman
    Nov 21 at 12:57
















Which texts? It helps to know what we are reacting to.
– Henk Holterman
Nov 21 at 12:57




Which texts? It helps to know what we are reacting to.
– Henk Holterman
Nov 21 at 12:57












1 Answer
1






active

oldest

votes

















up vote
1
down vote



accepted










By default, the LOH is not compacted at all. Because that could be expensive.



From 4.5.1 on, you can us GCSettings to change that. The choices are CompactOnce and Never.



So you can manually trigger a Compaction, driven by your application logic.



The LOH is only collected (sweeped) during a Generation 2 collection. That may cause your "after a while" confusion. But collection is not compaction.






share|improve this answer























  • Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
    – Benoit Sanchez
    Nov 21 at 13:21












  • Yes, it is only active for one Collect. That is what I meant with manually.
    – Henk Holterman
    Nov 21 at 13:46











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412261%2fdefault-strategy-for-large-object-heap-compaction%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
1
down vote



accepted










By default, the LOH is not compacted at all. Because that could be expensive.



From 4.5.1 on, you can us GCSettings to change that. The choices are CompactOnce and Never.



So you can manually trigger a Compaction, driven by your application logic.



The LOH is only collected (sweeped) during a Generation 2 collection. That may cause your "after a while" confusion. But collection is not compaction.






share|improve this answer























  • Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
    – Benoit Sanchez
    Nov 21 at 13:21












  • Yes, it is only active for one Collect. That is what I meant with manually.
    – Henk Holterman
    Nov 21 at 13:46















up vote
1
down vote



accepted










By default, the LOH is not compacted at all. Because that could be expensive.



From 4.5.1 on, you can us GCSettings to change that. The choices are CompactOnce and Never.



So you can manually trigger a Compaction, driven by your application logic.



The LOH is only collected (sweeped) during a Generation 2 collection. That may cause your "after a while" confusion. But collection is not compaction.






share|improve this answer























  • Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
    – Benoit Sanchez
    Nov 21 at 13:21












  • Yes, it is only active for one Collect. That is what I meant with manually.
    – Henk Holterman
    Nov 21 at 13:46













up vote
1
down vote



accepted







up vote
1
down vote



accepted






By default, the LOH is not compacted at all. Because that could be expensive.



From 4.5.1 on, you can us GCSettings to change that. The choices are CompactOnce and Never.



So you can manually trigger a Compaction, driven by your application logic.



The LOH is only collected (sweeped) during a Generation 2 collection. That may cause your "after a while" confusion. But collection is not compaction.






share|improve this answer














By default, the LOH is not compacted at all. Because that could be expensive.



From 4.5.1 on, you can us GCSettings to change that. The choices are CompactOnce and Never.



So you can manually trigger a Compaction, driven by your application logic.



The LOH is only collected (sweeped) during a Generation 2 collection. That may cause your "after a while" confusion. But collection is not compaction.







share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 21 at 13:07

























answered Nov 21 at 13:01









Henk Holterman

207k22225394




207k22225394












  • Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
    – Benoit Sanchez
    Nov 21 at 13:21












  • Yes, it is only active for one Collect. That is what I meant with manually.
    – Henk Holterman
    Nov 21 at 13:46


















  • Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
    – Benoit Sanchez
    Nov 21 at 13:21












  • Yes, it is only active for one Collect. That is what I meant with manually.
    – Henk Holterman
    Nov 21 at 13:46
















Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
– Benoit Sanchez
Nov 21 at 13:21






Thanks. But your phrasing suggests GCSettings.LargeObjectHeapCompactionMode is set forever while it's only a one shot assignation and will be reset after next blocking GC. docs.microsoft.com/en-us/dotnet/api/…. I think you should make it clear.
– Benoit Sanchez
Nov 21 at 13:21














Yes, it is only active for one Collect. That is what I meant with manually.
– Henk Holterman
Nov 21 at 13:46




Yes, it is only active for one Collect. That is what I meant with manually.
– Henk Holterman
Nov 21 at 13:46


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53412261%2fdefault-strategy-for-large-object-heap-compaction%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

A CLEAN and SIMPLE way to add appendices to Table of Contents and bookmarks

Calculate evaluation metrics using cross_val_predict sklearn

Insert data from modal to MySQL (multiple modal on website)