appdomain

CPU and Memory Cap for an AppDomain

耗尽温柔 提交于 2019-12-18 05:39:26
问题 I want to host an exe in an appdomain and assign a CPU and Memory cap to it so that it does not use more than the assigned processing power. Is this possible to do and how? 回答1: You can't cap the maximum memory directly, as far as I know. However, from .NET 4 on, the memory currently allocated by an AppDomain is available in the AppDomain.MonitoringSurvivedMemorySize property if AppDomain.MonitoringIsEnabled is set to true . You can spin up a watchdog thread to monitor allocations. 回答2: Looks

What is the right way to set shadow copying for the default AppDomain

怎甘沉沦 提交于 2019-12-17 23:38:49
问题 Relating to Can I make the default AppDomain use shadow copies of certain assemblies?, it describes a working solution to activate shadow copying within the default AppDomain for a specific directory. Basically it says to use these simple methods: AppDomain.CurrentDomain.SetShadowCopyPath(aDirectory); AppDomain.CurrentDomain.SetShadowCopyFiles(); But because the methods used here are marked as obsolete I was wondering what is now the correct way to accomplish the same. The warning message

I don't understand Application Domains

 ̄綄美尐妖づ 提交于 2019-12-17 15:19:04
问题 .NET has this concept of Application Domains which from what I understand can be used to load an assembly into memory. I've done some research on Application Domains as well as go to my local book store for some additional knowledge on this subject matter but it seems very scarce. All I know that I can do with Application Domains is to load assemblies in memory and I can unload them when I want. What are the capabilities other that I have mentioned of Application Domains? Do Threads respect

ASP.NET restarts when a folder is created, renamed or deleted

隐身守侯 提交于 2019-12-17 09:31:36
问题 UPDATE -- process to replicate issue: 1) Create a website project at c:\projects\restart-demo 2) Add default web.config and a dummy aspx page test.aspx 3) Map IIS to point to the root folder c:\projects\restart-demo 4) Monitor application restarts using perfmon, health monitoring, tracking in global.asax Application_End, etc. 5) Request page in browser http://localhost/test.aspx application start 6) Create new folder c:\projects\restart-demo\asdf application end 7) Request page in browser

Sharing data between AppDomains

99封情书 提交于 2019-12-17 04:55:07
问题 I have a process that can have multiple AppDomains. Each AppDomain collect some statistics. After a specified time, I want to accumulate these statistic and save them into a file. One way to do this is Remoting, which I want to avoid. The only other technique I have in mind is to save each AppDomain's data in a file, and after a specific time, one of the AppDomain collects all data and accumulate them. But it would be ideal if this all could be done in-memory, without the cost of serializing

List AppDomains in Process

此生再无相见时 提交于 2019-12-17 03:03:39
问题 Is there any possibility how to enumerate AppDomains within Process? 回答1: You may want to look at this post using System.Runtime.InteropServices; // Add the following as a COM reference - C:\WINDOWS\Microsoft.NET\Framework\vXXXXXX\mscoree.tlb using mscoree; public static IList<AppDomain> GetAppDomains() { IList<AppDomain> _IList = new List<AppDomain>(); IntPtr enumHandle = IntPtr.Zero CorRuntimeHostClass host = new mscoree.CorRuntimeHostClass(); try { host.EnumDomains(out enumHandle); object

How do I obtain a list of the application domains my application has created?

拈花ヽ惹草 提交于 2019-12-14 02:07:33
问题 I have a service app that creates AppDomain's during the course of its use for long running tasks. I've been tracking these by storing them in a Hashtable with a unique ID. After a task is completed the service app then unloads the AppDomain allocated to that task and then it's removed it from the appdomain Hashtable. Purely from a sanity checking point of view, is there a way I can query the CLR to see what app domains are still loaded by the creating app domain (i.e. so I can compare the

AppDomain support is dead in UnityEngine, any way to unload dll?

旧街凉风 提交于 2019-12-14 00:27:25
问题 I am kinda stuck on not being able to dispose .NET 3.5 dlls from the process. AppDomain support is off in unity, there is no way to unload a dll from the process using the .NET api, because the C# functions are not implemented. Anyone could get me some hints on how / where should I start to remove the dll from the memory / process somehow, so I can re-load the dll whenever I want? 回答1: Alright, after this time I thought that this is some sort of heavy research, and there are no publications

Garbage collecting objects crossing AppDomain boundary

送分小仙女□ 提交于 2019-12-13 13:31:14
问题 When you pass an object that inherits from MarshalByRefObject to a different AppDomain, won't GC.Collect() induced by the AppDomain that created it collect the object, provided that the object is not rooted in either AppDomain by the time GC.Collect() called? [When I say not rooted I mean no developer written code access it anymore.] It appears that the object is not getting collected but rather getting promoted to the next generation! But if I stop passing the object to a diff AppDomain, it

Performance of the FrameworkElementAdapters class

北战南征 提交于 2019-12-13 12:21:53
问题 Can't figure why cross-domain calls is so slow for FrameworkElementAdapters class. Here is a simple code: class Program { [STAThread] static void Main() { AppDomain domain = AppDomain.CreateDomain("AnotherDomain"); var instance = (AnotherDomainClass) domain.CreateInstanceAndUnwrap( typeof (AnotherDomainClass).Assembly.FullName, typeof (AnotherDomainClass).FullName); var contract = instance.CreateContract(); } } class AnotherDomainClass : MarshalByRefObject { public INativeHandleContract