From: lmauro AT scientist DOT com (Leo Mauro) Subject: RE: Cygwinb19.dll 26 Jun 1998 08:55:36 -0700 Message-ID: <000201bda0a0$a5e54700$1e6e31cf.cygnus.gnu-win32@leo-nt.rd.telesystech.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit To: On Thursday, June 25, 1998 06:24 AM, Edward Avis wrote: > AFAIK, Windows loads a _separate copy_ of each DLL for every program > that uses it. That's one of the reasons it uses so much memory. > > (Please tell me I'm wrong... :-( ) You're wrong. ;-) In fact, under both Win9x and NT each process runs in its own virtual machine, isolated from all the other processes (except 16-bit programs, which run all together in a single VM). Under each virtual machine, the DLLs required by the program are loaded at some virtual address. The same DLL can be loaded in more than one VM, maybe at different addresses. But it _is_ the same DLL, and even if it looks like it has been loaded multiple times, all the "copies" are actually sharing the same physical memory. This, of course, only applies to read-only code and data. Writeable data is actually replicated as many times as necessary. The main reason Windows 9x and NT uses so much memory is due to Microsoft having program size reduction way down in its priority list. After all, they work under the assumption that RAM, disk and CPU prices are always lower than the salaries of expert programmers able to trim down programs to reasonable sizes (not counting the time and expenses involved in the extra time it takes to optimize complex, code). To them it would always make more sense to sell the bloatware produced by automated code wizards (a.k.a. program generators to us old-timers) than to hire experts to write good, small code. Time/size tradeoffs have been known in CS for a very long time. But time used to mean run time, not time to market! Leo Mauro Principal Scientist TeleSys Technologies, Inc. - For help on using this list (especially unsubscribing), send a message to "gnu-win32-request AT cygnus DOT com" with one line of text: "help".