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.
精彩评论