Thanks for home work guys. Hey a note on the term "Dirty". I beleive it refers to the dirty bit in page directory entries PDE's and page table entries PTE's. It means that if set, the page has been written to since the operating system first loaded the page into memory.
Posted on 2003-10-20 16:43:31 by mrgone
That wasn't the "dirty" I had in mind - Qweerdy knew what I meant.

But that dirty pages are a thing to keep in mind too. If you succeed in creating a process from memory by yourself, all pages will be 'dirty' - so if memory gets low, the process will have to be paged to disk, instead of being discarded and re-read from file.
Posted on 2003-10-21 10:15:09 by f0dder
All functions used in the code are exported functions yet not documented by MS. Is that dirty or non-dirty? What do you mean by "all pages will be 'dirty' "? If you mean memory leaks from lack of decrement of reference counts this must be a surmountable obstacle. What is dirty pages?

Best regards
Posted on 2003-10-22 08:02:05 by minor28
semi-dirty perhaps? :) - but that's probably OK, I guess, as this is a rather unstandard thing to do. If the exported functions haven't changed interface since NT4, it's probably 'safe'.

As for "all pages will be dirty", think about a normal process created from a (nonpacked) executable file. Pages that haven't been written to (code, const data) are 'clean'... if memory runs low, such pages can simply be discarded, and if they're needed again, read directly from the executable file. If pages have been written to, they are dirty, and will have to be paged out to the paging file, and re-read from there if they're needed again.
Posted on 2003-10-22 12:42:29 by f0dder
If it is a 4Meg page than probably only one page is dirty. If 4k pages than only the ones written to will be dirty.
Posted on 2003-10-22 12:48:17 by mrgone
it would still be 4MB that would need to be paged out, though... and it would probably need to be paged out all at once? Ouch :)
Posted on 2003-10-22 12:51:47 by f0dder