Subject: RE: DLL Data and Copy-on-write (was RE: Why is cygwin.dll?)
From: [email-masked] (Fran Litterio)

20 Jan 1997 14:19:14 -0800
Approved: [email-masked]
Distribution: cygnus
Message-ID: <c=US%a=_%p=Amulet._Inc.%l=[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: 7bit
Original-To: "[email-masked]'" <[email-masked]>
X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63
Original-Sender: [email-masked]

[email-masked] wrote:

>By the way, from another part of Advanced Windows by Jeffery Richter
>(Microsoft Press):
>
>	"When an EXE or a DLL file is loaded from a floppy disk, both
>	Windows 95 and Windows NT allocate storage for the entire
>	file from the system's paging file. The system then copies the
>	file from the floppy into the system's RAM and the system's
>	paging file; the paging file is said to back the RAM."
>
>In other words a large DLL does in fact use virtual memory even if
>you don't ever call any of it's functions.

I think it's clear that Richter was only talking about DLLs loaded from
floppies.  If the DLL is loaded from hard disk, NT will do it the UNIX
way: NT will not "allocate storage for the entire file from the system's
paging file" but will page code directly from the filesystem (data pages
too until they're written to, at which point they go into per-process
swap).  The reason the whole DLL is put into swap when it comes from a
floppy is that paging from a floppy filesystem would make any
application that uses that DLL painfully slow.

So, under NT, a large DLL will not use much virtual memory unless you
write to lots of it's data pages.  A large DLL's code pages never end up
in the paging file (swap), unless the DLL is on a floppy.
--
Francis Litterio
[email-masked]
[email-masked]
http://world.std.com/~franl/
>
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".