有没有什么办法pre-分配堆在.NET运行库,就像-​​Xmx / -Xms在Java中? [英] Is there any way to pre-allocate the heap in the .NET runtime, like -Xmx/-Xms in Java?

查看:134
本文介绍了有没有什么办法pre-分配堆在.NET运行库,就像-​​Xmx / -Xms在Java中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在大多数平台上,并与多数JVM可以$ P $通过设置-Xmx和-Xms选项(或其变体)同样大小的P-分配在启动堆。

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.

是否有可能与.NET做同样的,如果是的话,怎么办?

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

推荐答案

可悲的是不,它不是,.the .NET运行库,使所有关于堆的大小和相对大小辈分决定给你。

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

你能做的唯一的事情就是垃圾回收器的服务器版本和工作站之一之间切换。这提供了更多的侵略性,在服务器版本的每个核心收集1 GC和preference保持应用程序响应的工作站之一。

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.

这篇关于有没有什么办法pre-分配堆在.NET运行库,就像-​​Xmx / -Xms在Java中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆