Results 1 to 3 of 3

Thread: memstat: memory status and large page blocks available

  1. #1
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,576
    Thanks
    790
    Thanked 687 Times in 372 Posts

    memstat: memory status and large page blocks available

    MEMSTAT prints memory status and tries to allocate all available memory using the largest possible blocks. It does it twice: first, using 4kb pages and again with 2/4 mb pages. This program is mainly useful to check whether you can run some software requiring large contiguous memory blocks, like 32-bit 7-zip or 7-zip in largepage (-slp) mode

    Program transcript, including several runs of 64-bit version. Note that set of 4mb-paged memory blocks differs from run to run, and that program is rather slow (about 20 secs on my box):
    Code:
    C:\>t memstat32.exe
    There is       17 percent of memory in use.
    There are   16360 total Mbytes of physical memory.
    There are   13447 free Mbytes of physical memory.
    There are   16374 total Mbytes of paging file.
    There are   12841 free Mbytes of paging file.
    There are    4095 total Mbytes of virtual memory.
    There are    4081 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated    2047 mb, addr=7FFF0000
    Allocated    1857 mb, addr=00790000
    Allocated     122 mb, addr=774F0000
    Allocated      13 mb, addr=75B40000
    Allocated       4 mb, addr=74E10000
    Allocated       3 mb, addr=76BB0000
    Allocated       3 mb, addr=75660000
    Allocated       2 mb, addr=74AB0000
    Allocated       1 mb, addr=00590000
    Allocated       1 mb, addr=753D0000
    Allocated       1 mb, addr=77040000
    Allocated       1 mb, addr=75A00000
    Total: 4063 mb
    
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Allocated    2044 mb, addr=80000000
    Allocated    1852 mb, addr=00A00000
    Allocated     120 mb, addr=77600000
    Allocated      12 mb, addr=75C00000
    Total: 4028 mb
    
    
    Elapsed time = 0.632 seconds
    
    
    
    
    
    
    C:\>t memstat64.exe
    There is       17 percent of memory in use.
    There are   16360 total Mbytes of physical memory.
    There are   13554 free Mbytes of physical memory.
    There are   16374 total Mbytes of paging file.
    There are   12932 free Mbytes of paging file.
    There are 8388607 total Mbytes of virtual memory.
    There are 8388597 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated   16383 mb, addr=0000000080000000
    Allocated    8191 mb, addr=0000000480000000
    Allocated    4091 mb, addr=0000000680000000
    Allocated     507 mb, addr=0000000000820000
    Allocated      30 mb, addr=0000000020420000
    Allocated      15 mb, addr=0000000022320000
    Allocated       9 mb, addr=0000000023320000
    Allocated       1 mb, addr=0000000000410000
    Total: 29233 mb
    
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Allocated    8424 mb, addr=0000000080000000
    Allocated    2280 mb, addr=000000028E800000
    Allocated     540 mb, addr=0000000000C00000
    Allocated     152 mb, addr=0000000022800000
    Total: 11396 mb
    
    
    Elapsed time = 17.393 seconds
    
    
    
    
    
    
    
    
    C:\>t memstat64.exe
    There is       17 percent of memory in use.
    There are   16360 total Mbytes of physical memory.
    There are   13543 free Mbytes of physical memory.
    There are   16374 total Mbytes of paging file.
    There are   12924 free Mbytes of paging file.
    There are 8388607 total Mbytes of virtual memory.
    There are 8388597 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated   16383 mb, addr=0000000080000000
    Allocated    8191 mb, addr=0000000480000000
    Allocated    4091 mb, addr=0000000680000000
    Allocated     507 mb, addr=0000000000650000
    Allocated      30 mb, addr=0000000020250000
    Allocated      14 mb, addr=0000000022150000
    Total: 29221 mb
    
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Allocated    8424 mb, addr=0000000080000000
    Allocated    2280 mb, addr=000000028E800000
    Allocated     484 mb, addr=0000000000A00000
    Allocated     108 mb, addr=000000001EE00000
    Allocated      24 mb, addr=0000000025A00000
    Allocated       4 mb, addr=0000000027200000
    Allocated       4 mb, addr=0000000027600000
    Total: 11328 mb
    
    
    Elapsed time = 17.497 seconds
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    C:\>t memstat64.exe
    There is       17 percent of memory in use.
    There are   16360 total Mbytes of physical memory.
    There are   13548 free Mbytes of physical memory.
    There are   16374 total Mbytes of paging file.
    There are   12948 free Mbytes of paging file.
    There are 8388607 total Mbytes of virtual memory.
    There are 8388597 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated   16383 mb, addr=0000000080000000
    Allocated    8191 mb, addr=0000000480000000
    Allocated    4091 mb, addr=0000000680000000
    Allocated     507 mb, addr=0000000000670000
    Allocated      59 mb, addr=0000000020270000
    Allocated      10 mb, addr=0000000023E70000
    Total: 29246 mb
    
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Allocated    9704 mb, addr=0000000080000000
    Allocated    1000 mb, addr=0000000000A00000
    Allocated     236 mb, addr=000000003F200000
    Total: 10940 mb
    
    
    Elapsed time = 5.934 seconds
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    C:\>t memstat64a.exe
    There is       17 percent of memory in use.
    There are   16360 total Mbytes of physical memory.
    There are   13521 free Mbytes of physical memory.
    There are   16374 total Mbytes of paging file.
    There are   12919 free Mbytes of paging file.
    There are 8388607 total Mbytes of virtual memory.
    There are 8388597 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated   16383 mb, addr=0000000080000000
    Allocated    8187 mb, addr=0000000480000000
    Allocated    4603 mb, addr=000000067FC00000
    Allocated      31 mb, addr=00000000006D0000
    Allocated       8 mb, addr=00000000026D0000
    Allocated       1 mb, addr=0000000002F00000
    Allocated       1 mb, addr=0000000003080000
    Total: 29218 mb
    
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Allocated    6452 mb, addr=0000000080000000
    Allocated    1964 mb, addr=0000000213400000
    Allocated     532 mb, addr=0000000000A00000
    Allocated     240 mb, addr=0000000021E00000
    Allocated      24 mb, addr=0000000030E00000
    Allocated       4 mb, addr=0000000032600000
    Allocated       4 mb, addr=0000000032A00000
    Total: 9220 mb
    
    
    Elapsed time = 420.470 seconds
    Attached Files Attached Files

  2. #2
    Expert
    Matt Mahoney's Avatar
    Join Date
    May 2008
    Location
    Melbourne, Florida, USA
    Posts
    3,257
    Thanks
    307
    Thanked 797 Times in 489 Posts
    I get this (2.0 GHz T3200, 3 GB, 32 bit Vista)

    Code:
    C:\tmp>memstat32
    There is       50 percent of memory in use.
    There are    3000 total Mbytes of physical memory.
    There are    1489 free Mbytes of physical memory.
    There are    6222 total Mbytes of paging file.
    There are    4608 free Mbytes of paging file.
    There are    2047 total Mbytes of virtual memory.
    There are    2035 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated    1874 mb, addr=009A0000
    Allocated     128 mb, addr=77680000
    Allocated      14 mb, addr=76660000
    Allocated       7 mb, addr=7F7F0000
    Allocated       7 mb, addr=75CE0000
    Allocated       1 mb, addr=00240000
    Allocated       1 mb, addr=00410000
    Total: 2034 mb
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Total: 0 mb...
    
    
    C:\tmp>memstat32
    There is       50 percent of memory in use.
    There are    3000 total Mbytes of physical memory.
    There are    1488 free Mbytes of physical memory.
    There are    6222 total Mbytes of paging file.
    There are    4607 free Mbytes of paging file.
    There are    2047 total Mbytes of virtual memory.
    There are    2035 free Mbytes of virtual memory.
    There are       0 free Mbytes of extended memory.
    
    Memory allocation using VirtualAlloc with 4kb pages:
    Allocated    1875 mb, addr=00840000
    Allocated     128 mb, addr=77680000
    Allocated      14 mb, addr=76660000
    Allocated       7 mb, addr=7F7F0000
    Allocated       7 mb, addr=75CE0000
    Total: 2033 mb
    
    Memory allocation using VirtualAlloc with 2/4mb pages:
    Total: 0 mb...

  3. #3
    Programmer Bulat Ziganshin's Avatar
    Join Date
    Mar 2007
    Location
    Uzbekistan
    Posts
    4,576
    Thanks
    790
    Thanked 687 Times in 372 Posts
    it's possible after long run of windows. memory space becomes fragmented and less large pages are available. if you can, try reboot the system and run the program

Similar Threads

  1. Replies: 2
    Last Post: 18th April 2011, 05:13
  2. PAQ8 - Download Page
    By Jan Ondrus in forum Data Compression
    Replies: 7
    Last Post: 7th October 2010, 22:14
  3. Compression Page
    By toffer in forum Data Compression
    Replies: 1
    Last Post: 29th July 2010, 00:13
  4. BWTS STATUS OF PAPER
    By biject.bwts in forum Data Compression
    Replies: 20
    Last Post: 4th September 2009, 22:10
  5. 2G+ memory blocks
    By Shelwien in forum Data Compression
    Replies: 0
    Last Post: 6th March 2009, 03:13

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •