Ya
Ya) After 10 calculations, 1.2 GB memory used, etc. (not released). ( The tests were carried out on Automation(). Because, in Automation 2() i can't run the calculation a second time. Exception -> System.NullReferenceException: "Object reference not set to an instance of an object." here : Automation2 automation2 = new Automation2(); )
Ya) After 10 calculations, 1.2 GB memory used, etc. (not released).
Ok, i find a plug for exception [STAThread] public static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; DWSIMLoader.Execute5(); //load and SolveFlowsheet Console.ReadLine(); } but memory is also busy as in Automation(). May be AssemblyResolve stores data in memory?
Ok, i find a plug for exception [STAThread] public static void Main(string[] args) { AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; DWSIMLoader.Execute5(); //load and SolveFlowsheet } but memory is also busy as in Automation(). May be AssemblyResolve stores data in memory?
Automation2 automation2 = new Automation2(); Exception at line: IFlowsheet flowsheet = automation2.LoadFlowsheet(modelPath); The calling thread must be STA, because many UI components require this.
Hello Daniel, I have a simple project on c# net 6.2, dwsim 6.7.0: Main part of code: AppDomain.CurrentDomain.AssemblyResolve += ResolveAssembly; //for initialization dll ... Automation automation = new Automation(); IFlowsheet flowsheet = automation.LoadFlowsheet(modelPath); DWSIM.FlowsheetSolver.FlowsheetSolver.SolveFlowsheet(flowsheet, DWSIM.GlobalSettings.Settings.SolverMode); Then I tried to clear the memory: automation.ReleaseResources(); flowsheet = null; GC.Collect(); I see that it doesn't...