1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

Memory useage variations, PIII vs P4, or what?

Discussion in 'Intel' started by John Fryatt, Mar 15, 2005.

  1. John Fryatt

    John Fryatt Guest

    Hi,

    I have been monitoring memory usage on two PCs to gather info. re. a RAM
    upgrade, and found discrepancies in the amount of memory a module takes
    on two PCs.

    1) Dell Dimension 8300, P4 3GHz, 1GB RAM, XP Pro
    2) Dell Latitude CPxJ, PIII 750MHz, 512MB RAM, XP Pro

    If I run task manager and look at the processes tab, on each machine,
    they show that similar processes are using different amounts of memory.

    Examples
    avgcc.exe uses 10,860K on the Dimension, and 9,500K on the Latitude
    zlclient.exe 3,196 2,820
    services.exe 3,136 2,936
    taskmgr.exe 4,396 3,548

    avgcc.exe is part of the AVG anti-virus package and I'd assume that it
    would use the same amount of memory on any machine. That assumption is
    wrong, obviously, but why should that be?
    (I'm only giving AVG as a example, every process uses more memory on the
    Dimension.)

    Any thoughts?

    Regards, John
     
    John Fryatt, Mar 15, 2005
    #1
    1. Advertisements

  2. John Fryatt

    Brian Guest

    Dimension has more RAM therefore programs use more memory. If you ran this
    same test on an identical machine with 64MB RAM what do you think the reults
    would be :)
     
    Brian, Mar 15, 2005
    #2
    1. Advertisements

  3. John Fryatt

    John Fryatt Guest

    I don't see that. Why should programs use more memory just because it's
    there?
     
    John Fryatt, Mar 15, 2005
    #3
  4. John Fryatt

    Yousuf Khan Guest

    Demand-based paging. Think of RAM as simply a disk cache. A program is
    loaded from disk into memory. But the whole program is rarely ever
    loaded into memory these days (like they used to be in the old DOS
    days). Only the portion of the program that is required now is loaded in
    now. If other parts of the program are required later, then those parts
    are paged in later, while unused portions of that program are discarded
    back to disk. The more ram you have, the less that has to be discarded
    right away back to disk.

    Yousuf Khan
     
    Yousuf Khan, Mar 15, 2005
    #4
  5. John Fryatt

    John Fryatt Guest

    Ok... If you are talking about virtual memory, then I still don't see
    it. These machines have quite a lot of memory and no big application is
    running during my observations, so they are not anywhere near 'full'.
    As far as I can see no paging is happening.

    Surely the same process would have the same size working set on both
    machines? There is memory to spare and no paging is happening, unless I
    am missing something.
     
    John Fryatt, Mar 15, 2005
    #5
  6. There could be a lot of reasons. One reason is that a lot of software
    auto-tunes its memory usage based upon memory availability. If more memory
    is available, the programs make size/speed tradeoffs in favor of speed
    rather than size.

    Another is memory pressure. The operating system is constantly trying to
    use your RAM for the most ideal purpose. Memory pressure on the machine with
    less RAM may simply have caused more of the initialization code or unused
    assemblies attached to used assemblies to be discarded than on the machine
    with more memory.

    http://getdotnetco.web101.discountasp.net/GdncStore/free/Articles/The Memory Mystery.htm

    DS
     
    David Schwartz, Mar 15, 2005
    #6
  7. John Fryatt

    John Fryatt Guest

    Thanks David. I understand what you say about memory tuning, although I
    am a little surprised that every process uses more memory on the bigger
    machine. But maybe it's very common practice to do this tuning?
    Re. memory pressure, I suppose that the OS might leave more of each
    process in memory if there is more 'spare' memory. I'm getting into
    speculation now so I'd better stop and do a bit more reading.
    That site that looks interesting. I'll read it thoroughly when I get a
    minute. Inevitably, this subject is a little more complex than I perhaps
    expected. ;-)
     
    John Fryatt, Mar 15, 2005
    #7
  8. Yes, it is. You're making some very simple assumptions about some very
    complex code. For example, every program, more or less, uses the memory
    allocation routines provided by the system library. They may be tuned in
    this way.
    Correct. That's exactly what it does.
    Yes. The code, both in the applications and in the OSes memory manager,
    are so complex that you can't make simple assumptions.

    DS
     
    David Schwartz, Mar 15, 2005
    #8
  9. John Fryatt

    John Fryatt Guest

    Ah, yes. Good point.
    Yes, as an IT person (although I haven't done programming for a good few
    years) I should have been more careful of doing that. ;-)

    I still find it a little mind-boggling at times, to think that my
    current PC has over 1500 times as much memory as my first (XT) PC!

    John
     
    John Fryatt, Mar 15, 2005
    #9
  10. John Fryatt

    Yousuf Khan Guest

    Sure as far as you're concerned no paging is happening, but in fact
    there's paging operations happening thousands of times per second on
    these machines. Most of them can be satisfied without going to disk, due
    to various optimizations.

    One such paging optimization is extremely simple, almost bordering on
    stupidly simple. It involves the fact that executable files will never
    change on the disk. If you think about it, executables are operationally
    read-only files on disk, you only read them into memory and that's it;
    they will never need to be written back to disk because they never
    change. Well, they may change if you upgrade them to a newer version or
    apply patches and that sort of thing, or if perhaps a virus infects it
    -- but those are unusual operations. So any stale page that is mapped to
    an executable file on disk, will simply get discarded, it doesn't need
    to be written back to disk; when that page is needed in memory again,
    you just read it in from the original executable file again.

    Another optimization that can be performed involves paging back in from
    memory. The OS continuously scans the pages in memory for activity, and
    it marks any pages not used recently as "free". Once the area is marked
    as free, it's now available to be overwritten from somewhere else. But
    often times, it seems pages that have been marked as free and have not
    yet been overwritten by another page, can simply be brought back into
    the active pool without reading back from disk.

    The OS sets paging limits based how much physical memory is on the
    machine. For example, it might not so aggressively mark a page as free
    if there is more physical memory available, so you'll end up seeing more
    old pages being kept resident. Also another thing it might do more
    reading ahead if there is more memory available, so loading in more
    pages ahead of time, even if they aren't quite needed yet. Since going
    to disk is a high-latency operation, the OS will tend to read as many
    pages ahead as possible -- thus minimizing the number of disk
    operations. It's better to read ten pages in one operation than it is to
    read ten pages individually.

    Yousuf Khan
     
    Yousuf Khan, Mar 15, 2005
    #10
  11. Yeah. I compare the PC I have now to the 'PC' I had in 1980. 15,000
    times the memory, 300,000 times the mass storage space, and 9,000 times the
    processing power. I wonder what I'll have in 2030.

    DS
     
    David Schwartz, Mar 15, 2005
    #11
  12. John Fryatt

    John Fryatt Guest

    I think perhaps I'd use slightly different terminology, but I see what
    you are getting at. A lot of what you describe I'd call 'memory
    management', or something like that. Paging, as I understand it, means
    writing memory blocks to the paging file on disk, and reading them back
    in again when required.
    Thanks for the advice anyway. This is a complex subject and I think a
    bit more reading is required.

    John
     
    John Fryatt, Mar 16, 2005
    #12
  13. John Fryatt

    Yousuf Khan Guest

    To me, paging and memory management are the same thing. The specific act
    of paging memory to disk is just a subset of all of the operations that
    can really be done with paging.

    Yousuf Khan
     
    Yousuf Khan, Mar 16, 2005
    #13
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.