Years and years ago, before Windows, if you had an executable that was 25KB 
that's what it took to run, plus whatever extra memory it requested from the 
operating system for variables.  

Short version of what follows: Programs with GUI interfaces (in particular) use 
a lot more memory than just the executable itself.

Longer version: 

Under Windows, the size of the program itself is only part of what's required 
and the explanation can get very complicated. I've got a tool (Google 
"sysinternals VMMap" if you're interested) that shows what all the memory is 
used for. Briefly, about 4MB is in fact used for the executable code. However, 
another roughly 50MB is used to load DLLs (dynamic linked libraries) that the 
program needs to operate. There is another MB used for mapped files, which is a 
quick way to store data so it doesn't have to be fetched from disk every time 
it's needed. A simple example is are things like the cities, states, lakes, 
rivers, etc. that are needed for the map, but a whopping 18MB is used to cache 
fonts. (I'd need to check, but that's probably something common to Windows 
programs). There's another 35MB of Shareable memory which can be used for 
things like inter-process communication. I can't tell specifically what it's 
used for, Paul would have to tell you. There's 15MB used for various stacks, 
which is part of how programs run. The biggest remaining chunk at about 210MB 
is for Private Data, which is typically used for variables in the program. 
Again, Paul would have to explain how things are organized in the program.

For those of you keeping score, you'll note that what's shown adds up to way 
over 193MB. In fact, adding in a few things that I left out shows that there is 
actually just under 354MB allocated to the dx4win.exe process. Where does the 
195MB number come from? That's what's known as private memory that's directly 
"charged" to the program that can't be used by the system for anything else. 
All the other memory is (sort of) shareable between other processes if more 
memory is needed. It turns out that of that 195MB the vast majority is used by 
Private Data (189MB) and the rest by portions of all of the rest.

So in summary, there's unlikely to actually be anything wrong here at all. 
While it seems astonishing to those of us who grew up and built PCs and did 
upgrades by buying 256 BYTE chips one at a time when we could afford them, this 
might seem totally insane, but we live in a world where a machine with 4GB of 
RAM is probably considered the bare minimum these days (running Windows; Linux 
can be massively more frugal).

For those of you who already know about this kind of thing, I'm aware that I've 
simplified a lot and left out a lot of details, and I've kind of mangled the 
concept of Private Bytes vs. Working Set, etc.). This was the best simple-ish 
explanation I could come up with and still try to answer Len's question. Flames 
to me off-list please.

73,
David, K2DBK
 

-----Original Message-----
From: dx4win-boun...@mailman.qth.net <dx4win-boun...@mailman.qth.net> On Behalf 
Of Len K1NU
Sent: Wednesday, August 14, 2019 8:23 PM
To: dx4win@mailman.qth.net
Subject: [Dx4win] D4W v9 memory size?

So, I just happened to be in Task Manager in Windows 7, and noticed that D4W 
was taking up 195MB(!) of RAM. I shut it down, and restarted it fresh. No 
change.

Can someone explain this?  Seems like something’s wrong. The .exe is 4MB, the 
.wav files are 1MB, and my log is 7MB.   What’s using the other 183MB??  It 
can’t be all databases. :)

73 Len K1NU
______________________________________________________________
DX4WIN mailing list
Home: http://mailman.qth.net/mailman/listinfo/dx4win
Help: http://mailman.qth.net/mmfaq.htm
Post: mailto:DX4WIN@mailman.qth.net

This list hosted by: http://www.qsl.net
Please help support this email list: http://www.qsl.net/donate.html

______________________________________________________________
DX4WIN mailing list
Home: http://mailman.qth.net/mailman/listinfo/dx4win
Help: http://mailman.qth.net/mmfaq.htm
Post: mailto:DX4WIN@mailman.qth.net

This list hosted by: http://www.qsl.net
Please help support this email list: http://www.qsl.net/donate.html

Reply via email to