> A freaking notepad app takes almost 50mb in memory when equivalent NOTEPAD done in pure Win32 C takes 1.8mb of memory.
1.8MB? I don't know how much it took on our 386 computer with 4MB RAM and windows 3.11, but hopefully not that much
Given that I assume NOTEPAD.EXE is still basically a window containing an optional status bar and a multiline edit control with a custom WNDPROC for managing features like word wrap, I'm actually curious why it opens with such a large private working set, even on Windows 11.
Possibly space for data allocated by one of the 50+ DLLs it loads directly or indirectly to support features like Unicode text input and rendering.
Actually, it gets much worse. By default, recent Windows 11 versions use a completely new version of Notepad with support for things like tabs, styled text, and AI (!).
Even with all the new features disabled, this one has a 32 MB private working set before opening a single file.
Amusingly, GNU Emacs, a.k.a. Eight Megabytes And Constantly Swapping at a time when entry-level UNIX workstations actually shipped with as little as 4 MB RAM, opens on the same machine with a smaller (25 MB) private working set than the new Notepad.
To be fair to at least one team at Microsoft, the EDIT.EXE text-mode editor recently added to Windows 11, with a user interface that somehow manages to be more consistent with basic Windows UI conventions than many modern Windows GUI apps despite not being a GUI app at all, opens with a private working set size of only 520 kB.
Even a minimal Hello World program (1.5KB executable) takes 340K of active private working set, and 552K of commit size. Windows just don't allow programs to use any less memory than that. You're bound by what the system libraries allocate (either statically or dynamically).
Once you create a window, even if you haven't drawn that window, your minimum is now around 500KB.