Max number of appdomains loaded in one process

帅比萌擦擦* 提交于 2019-12-19 19:58:04

问题


Since dynamic assembly loading requires appdomain loading to enable killing the assembly with unloading related appdomain, is there a "max" number appdomains in a process to be loaded? I am thinking of a server based application that each user can run his proprietary C# code dynamically. But what if, say, 2000 users log in and load their codes? Are there any possible restrictions I might encounter besides the number of appdomians?

thanks.


回答1:


Almost all CLR limits are based on "as memory permits". The only exception I know of is the number of members of a class, restricted to 65536. That's based on the definition of a token value. Nothing like that for AppDomains.




回答2:


I don't believe that there is a definitive maximum value in-built in the CLR. Rather it would be the amount of memory left which determines if you can dynamically load a new appdomain.

I'll do a bit of research, but I don't think there is a value set for this.

EDIT:

Here's another post which might help clear things up.




回答3:


Mostly it would be defined by your OS limits. Your x86 machine can't use more than 4GB in memory for a process [only 2GB in user mode]. If you go for x64 you have a much bigger limit. From what I know there is no such limit to the number of Application Domains you can create.



来源:https://stackoverflow.com/questions/4135756/max-number-of-appdomains-loaded-in-one-process

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!