开发者

Is there any way to pre-allocate the heap in the .NET runtime, like -Xmx/-Xms in Java?

开发者 https://www.devze.com 2022-12-20 05:13 出处:网络
On开发者_运维知识库 most platforms and with most JVMs you can pre-allocate the heap on start-up by setting the -Xmx and -Xms options (or a variant thereof) to the same size.

On开发者_运维知识库 most platforms and with most JVMs you can pre-allocate the heap on start-up by setting the -Xmx and -Xms options (or a variant thereof) to the same size.

Is it possible to do the same with .NET, and if so, how?


Sadly no it's not, .the NET runtime makes all the decisions about heap size and relative generational sizing for you.

The only thing you can do is switch between the server version of the garbage collector and the workstation one. This gives more aggressive, one GC per core collecting in the server version and a preference for keeping the app responsive in the workstation one.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号