Re: Limit the memory for a child process

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have actually tried that function. I call it on the handle returned by
CreateProcess, before I start the child process. However, it does not seem
to limit. I have written a test, which tries to allocate more memory than
specified in the limit for SetProcessWorkingSetSize, and the process
allocates it without problem.

I also fill the memory with garbage, so it really does get allocated.

-Lenard

"Bonj" <a@xxxxx> wrote in message
news:u31DLZ1TFHA.3392@xxxxxxxxxxxxxxxxxxxxxxx
> Check out the function SetProcessWorkingSetSize.
>
> "Lenard Gunda" <arthur.darkholme@xxxxxxxxxx> wrote in message
> news:%23wNRQY1TFHA.2172@xxxxxxxxxxxxxxxxxxxxxxx
>> Hi
>>
>> I am writing a system that needs to start other applications, and needs
>> to evaluate those applications. However, I would like to be able to
>> restrict the amount of memory these child processes can consume.
>>
>> What I need is: before or after the process is created, I would like to
>> set a memory limit (like 16Mb, 64Mb, etc) on the child process. The child
>> process should not be able to consume (allocate) more memory, be it real
>> or virtual, than this limit.
>>
>> Is this possible in any way?
>>
>> Thank you
>>
>> -Lenard
>>
>
>


.



Relevant Pages