Memory limit for a new process

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

I was trying to write an application which would start a new process. But
the problem is, I want to put a limit on the size of stack and heap for the
process. In case the given limit is exceeded, I would like the process to
terminate.

I guess, I should try using System.Diagnostics.Process class. There is
MaxWorkingSet property, but I am not sure, if that is what I need. And again,
it can only be set after the process is started -- not the thing I need.

Any ideas?

Regards,
Mantas
 
why?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
 
Well, it is sort of a testing system, or a judge, if you will. If you are
familiar with different programming competition, where your program gets a
set of input and must give a correct output, you should have a clear picture
of the purpose of my program.

Anyway, I have figured out that Process.PeakPagedMemorySize works more or
less the way I expect. But how do I get the value of this property, if my
process lasts for only 0.2 sec, or probably less?

The same problem with determening start time of the process.


Regards,
Mantas

Alvin Bruney - ASP.NET MVP said:
why?

--
Regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
The Microsoft Office Web Components Black Book with .NET
Now Available @ www.lulu.com/owc
Forth-coming VSTO.NET - Wrox/Wiley 2006
-------------------------------------------------------



Mantas said:
Hi,

I was trying to write an application which would start a new process. But
the problem is, I want to put a limit on the size of stack and heap for the
process. In case the given limit is exceeded, I would like the process to
terminate.

I guess, I should try using System.Diagnostics.Process class. There is
MaxWorkingSet property, but I am not sure, if that is what I need. And again,
it can only be set after the process is started -- not the thing I need.

Any ideas?

Regards,
Mantas
 
Back
Top