Firstly, the Task Manager, or whatever tool you are using to measure the memory is doing you a disservice. It is showing you the total amount of physical RAM being consumed by the app, including all the ReadOnly, ExecuteRead, WriteCopy segments which are shared between all running copies of the application.

Note: I'm assuming that Terminal Server shares dlls between sessions.

What that means is starting the first copy of an app will consume the amount of memory shown. But starting a second and subsequent copies, a large proportion of that "Working Set Allocation", will be shared between those copies and so consume no extra physical RAM. It will simply be mapped into the memory space of each copy of the app.

The Win32::GUI app will always consume least memory. In part, because most of the code it uses is already loaded (User32.dll, GDI.dll) for use by systems apps. In part because, it is just a thin wrapper over those system dlls, whereas the other two have whole rafts of platform independant interfaces layered on top of the system dlls.

It's also worth noting that with Win32::GUI, adding complexity to your user interface, extra windows and dialogs, will have little effect on the memory consumption, because you already loaded all the code (GUI.dll). Whereas with for example Tk, each new type of component you use will require another dll to be loaded.

The best way to determine the extra physical ram consumed by an app is to note the Physical Memory Available (Performance tab of the Task Manager) when you've loaded one copy, start a second copy and note it again. That will give you the cost of each new copy which will be considerably less than the headline figure attributed to the app.

For Win32::GUI apps, it comes out at around 3.5MB per copy on my system. Not trivial, but 30x3.5 is better than 30x6.9 :)


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to Re: Memory requirements for a Win32 GUI by BrowserUk
in thread Memory requirements for a Win32 GUI by pvbcharon

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.