2

I have a program that is pretty much modeled after the Answer by Alexander here:

Working example of CreateJobObject/SetInformationJobObject pinvoke in .net?

However, I want to also limit the amount of memory each child process can use, and I have absolutely no idea how to do it. I see the ProcessMemoryLimit in JOBOBJECT_EXTENDED_LIMIT_INFORMATION, but really haven't the slightest idea what data I need to put there. is it just a number in KB? Is there an object I need to build? And I can't seem to find any documentation on the matter.

Anyone have experience here?

Community
  • 1
  • 1
Michael Holman
  • 901
  • 1
  • 10
  • 26
  • Fairly sure you specify *bytes*, pick a multiple of 64K. Simplest way to be sure is to just try it of course. Job objects look good on paper but are very rarely useful in practice. Intentionally crashing an app just isn't that practical. They also got badly broken in Vista, the shell puts a process you start with a shortcut in a job object, preventing them from joining another. Not sure if that got fixed in later Windows versions, I stopped looking. – Hans Passant May 17 '13 at 10:16

0 Answers0