c# - Set artificial memory restrictions -
i'm writing little performancetest programm , try artificially restrcit memory can used during test. of tests taking hours run while processing multiresolution images 100 gb.
ideal set restrictions per thread think not work. tests executed in separate process or in separate appdomain. know how monitor (but not restrict) resources of appdomain arm , etw , have tried set maxworkingset on process level has no effect until systems memory under pressure.
of cause, there other ways , workarounds accomplish e.g running tests in vm or restricting windows memory on boot options. starting second process allocates huge amount of memory.
is there way artifically restict pysical memory process/appdomain can use if there free physical memory available on system? may posible restrict virtual memory too?
not aware of such functionality available, restrict memory consumption (in contrast usage).
so when start test have counter of how many objects/threads can create , operate on. if counter value reaches max allowed value test waits until 1 of threads/objects finishes job.
if use parallel
class can set max degree of parallelisation.
Comments
Post a Comment