From: flitterio AT amulet DOT com (Fran Litterio) Subject: RE: DLL Data and Copy-on-write (was RE: Why is cygwin.dll?) 20 Jan 1997 14:19:14 -0800 Approved: cygnus DOT gnu-win32 AT cygnus DOT com Distribution: cygnus Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Original-To: "'gnu-win32 AT cygnus DOT com'" X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.994.63 Original-Sender: owner-gnu-win32 AT cygnus DOT com colin AT bird DOT fu DOT is DOT saga-u DOT ac DOT jp 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 franl AT amulet DOT com franl AT world DOT std DOT com http://world.std.com/~franl/ > - For help on using this list, send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".