[Robelle] [SmugBook] [Index] [Prev] [Next]

Pages, Bytes, and Other Units of Measure

Memory on HP computers is measured in bits, bytes, words, pages, sectors, megabytes and gigabytes, among other units of measure.


The address space of the PA-RISC machines is divided into units of 2048 bytes, called pages. If you need 20 bytes of memory, you get a page. HP-UX allocates main memory and file space in 2048-byte physical pages, but MPE/iX manages file system space in logical pages which are 4096 bytes: twice as large. MPE manages things this way for its own performance reasons.

To see how memory is being used, run the Pages Memory Monitor. On MPE V disc space was managed in Sectors of 256 bytes and MPE/iX often refers to sectors as well. Just remember that a software page is 16 sectors.


Sectors are an archaic measure of disc space sometimes used on MPE. For example, the :Listf and :Listfile commands show disc space allocated to files in sectors. A sector is 256 bytes. Just remember that MPE/iX disc space is actually allocated in software pages which are equal to 16 sectors.


A byte is eight bits and can hold a value from 0 to 255 (2 to the 8th power, less 1). Bit stands for binary digit, or a number place that can have only two values: 0 or 1. Remember that HP numbers bits from the left, starting with zero.


The word is the basic unit for accessing computer storage on a particular machine, usually the size of each instruction and the size of the data value which is most efficiently processed. The word on a PA-RISC machine is 32-bits (4 bytes), while a word on the Classic HP 3000 is 16-bits (2 bytes). A byte is 8 bits and 16-bits is called a halfword on PA-RISC machines. There are Machine Instructions to load and store words, halfwords, and bytes.


The halfword is a unit of storage on PA-RISC machines, equal to 16-bits or half of a 32-bit Word.


A kilobyte (KB) is 1024 bytes, or 2 to the 10th power.


A megabyte (MB) is a memory space measure equal to 1,048,576 bytes (1024 times 1024), or 2 to the 20th power. A megabyte is equal to 4,096 MPE sectors, 512 PA-RISC hardware Pages, or 256 MPE/iX software pages. 1,024 megabytes is a gigabyte.


A gigabyte (GB) is a measure of memory space equal to 1024 megabytes or 1,073,741,824 bytes (2 to the 30th power). A gigabyte is equal to 4,194,304 MPE sectors, 524,288 hardware PA-RISC pages or 262,144 software MPE/iX pages.

Extents are Chunks of Disc Space

Disc space is measured and allocated in different ways on different operating systems. MPE nominally measures space in 256-byte sectors and allocates files in units of contiguous space called extents. MPE/iX actually allocates space in multiples of 4,096-byte pages not sectors, but it continues to measure the space in sectors for backward compatibility.

Extents are a feature of MPE/iX left over from MPE V. They can almost, but not completely, be ignored. On MPE V, all extents must be the same size (except the last) and the maximum per file is 32. This can make it hard to find big enough chunks of free disc space for a large data file. On MPE/iX a file can have unlimited extents and they don't have to be the same size. Many MPE/iX files, such as Obj files, have a Record size of 256 bytes, a Record Limit of 4,096,000, and unlimited extents.

Stan Sieler points out that extents are not actually unlimited:

While there is no hard-coded limit, it turns out that the number of extents for a single file is limited at least by the maximum size of a Label Table (because all of the extents are recorded in the Label Table). A Lable Table has no hard-coded entry limit, but is limited to a maximum of 20 extents, all on the same disc drive. Anyway, I conjecture that an approximate limit on the number of extents (assuming a big disk drive, and no other files in the Label Table!) is about 15,728,100 extents. :)

Transient Disc Space

On MPE disc space is measured in sectors and allocated to files in extents. Use :dstat all to show the disc drives on your MPE system. Use :discfree to explore disc space usage and :report nogroup.@ to print the disc space used by all the accounts on your system. Use the MPEX command %listf @.@.@(sectors>10000 and accdate < today-90),2 to find the big files that haven't been used in 90 or more days.

Transient disc space is space managed by MPE for user data stacks and heaps, and other temporary data structures. It can consume up to 1 gigabyte per process, especially if you link your file with the default NM stack size of 96 megabytes (this allocates at least one 2048-sector piece of transient space, even for a CM program that never uses the NM stack). See SYSGEN for maximum NMHEAP and MAXNMSTACK. If the sum of these is greater than 1 GB, then 1 GB is the limit, since this space is accessed through Space Register 5. Transient space is similar to Swap Space on HP-UX.

HP-UX measures space in 1024-byte blocks in bdf, but 512-byte blocks in df. The df command is a standard UNIX report of free disc space. bdf is a nicer Berkeley form of df supplied with HP-UX; it shows free and used disc space on each file system (it does not include Swap Space and other overhead disc space). Here is some sample bdf output:

Text version.

Filesystem kbytes used avail capacity mounted on
dumbo.robelle.com:/sys/apps 62712045571217140873%/pcserver/sys/apps

The /vg00 file systems are logical subdivisions of the hard drive allocated to different subdirectories under the root directory. The idea is similar to account and group limits in MPE. The dumbo file system is a LAN PC server, mounted as a Network File System on UNIX. And the last two are CD-ROM drives with the HP-UX and MPE manuals mounted. The capacity column is sort of equivalent to MPE/iX's max Perm percent, in that 100 percent doesn't mean that the disc is full. HP-UX generally makes the disc look 100 percent full when it is actually about 90 percent full. The remaining 10 percent is given only to superuser.

bdf reports kilobytes free per HP-UX file system. See /etc/checklist/ for all file systems known to your HP-UX system and /etc/mnttab/ for all file systems which are mounted. Disc space is managed as "device-files"; see /dev/dsk/* for all disc devices. When you run out of disc space, the error you see is "No space left on device." To find out who is using the disc space on HP-UX, try du -s /users/*. This shows how many 512-byte blocks are used by each subdirectory under /users.


Operating systems allocate disc space in chunks as they create and expand files and transient disc space (swap areas, etc.). When files are purged, these chunks are released for re-use. Over time the disc space may end up "fragmented" into many small pieces, which can slow the performance and the reliability of the system.

To observe and correct MPE fragmentation on MPE, use the De-Frag/X product from Lund Performance Software or use the Contigvol command of MPE/iX 5.0's Volutil program (it creates contiguous free disc space on a volume; Contigvol appears to work about as well as VINIT CONDense did -- that is, it's stable and reliable, but requires multiple passes to get the best results).

To learn all about fragmentation, see Stan Sieler's paper "Analysis and Correction of Fragmentation Problems." Here's an example of the De-Frag/X display of disc drive fragmentation. (You can also zoom in on a single chunk of the display.)

:run defragx.pub.lps

De-Frag/X  A.03c (run on  3/02/95 18:49:03.4)
Copyright (c) 1993 Lund Performance Solutions

MPE/iX 5.0 (or later)

# Boots since INSTALL          :       236
Total # of mounted disks       :         6

Size of largest currently mounted disk = 163,735 pages (639 MB).

Note: system appears to have been started by a SOFT-boot (^B TC).

De-Frag/X> map 11
Ldev   11:   (Each chunk represents 168 pages, or  .7 MB)
   [PPPPPPPPPPPPPPPPPPPPp*p*************ppPp************************]  9
   [*********************************pPPPPPPPPPPPPPPPPPPPPPPPPPPPPPp] 10
   [****************************************************************] 11
   [****************************************************************] 12
Col[0....+....10...+....20...+....30...+....40...+....50...+....60..] Row
Available Permanent Disk:  134 MB (disk size:  544 MB)
   Free       *   Permanent  P   Transient  T   unmovable  X
   part Perm  p   part Trans t   same_ldev  x

Disc "Megabytes" Versus RAM Megabytes

Disc memory is measured differently from RAM memory by the disc manufacturers. Disc space typically uses megabyte to mean 1,000,000 bytes and gigabyte to mean 1,000,000,000 bytes. HP does this, as do many other disc companies. Computer manufacturers use megabyte to mean 1,048,576 bytes and gigabyte to mean 1,073,741,824 bytes. So 1 MB of main memory won't fit in 1 MB of disc swap space!

IEC Standards: Binary versus Decimal

Branislav Vracaric (vracaric at rogers dot com) writes on the RAM versus Disc controversy:

"In 1998, the International Electrotechnical Commission approved international standard names and symbols for prefixes for BINARY multiples:"

Name   Symbol  Origin       Factor
kibi   Ki      kilobinary   2 on power of 10
mebi   Mi      megabinary   2 on power of 20
gibi   Gi      gigabinary   2 on power of 30
tebi   Ti      terabinary   2 on power of 40
pebi   Pi      petabinary   2 on power of 50
exbi   Ei      exabinary    2 on power of 60

"Comparing those to DECIMAL prefixes we find that:

one kibibyte (1 KiB) = 2 on power of 10 byte = 1,024 B; but one kilobyte (1 KB) = 10 on power of 3 byte = 1,000 B;

one mebibyte (1 MiB) = 2 on power of 20 byte = 1,048,576 B; one megabyte (1 MB) = 10 on power of 6 byte = 1,000,000 B.

one gibibyte (1 GiB) = 2 on power of 30 byte = 1,073,741,824 B; one gigabyte (1 GB) = 10 on power of 9 byte = 1,000,000,000 B. etc.

"So, prefix "kilo" means 1,000 (not 1,024 as pointed out on your WEB page), mega is 1,000,000 (not 1,048,576 or 2 to the 20th power), giga is 1,000,000,000 etc."

Thanks Branislav. Here are some web sites that discuss this issue:

National Institute of Standards and Technology:

"Once upon a time, computer professionals noticed that 2^10 was very nearly equal to 1000 and started using the SI prefix "kilo" to mean 1024. That worked well enough for a decade or two because everybody who talked kilobytes knew that the term implied 1024 bytes. But, almost overnight a much more numerous "everybody" bought computers, and the trade computer professionals needed to talk to physicists and engineers and even to ordinary people, most of whom know that a kilometer is 1000 meters and a kilogram is 1000 grams."

"Then data storage for gigabytes, and even terabytes, became practical, and the storage devices were not constructed on binary trees, which meant that, for many practical purposes, binary arithmetic was less convenient than decimal arithmetic. The result is that today "everybody" does not "know" what a megabyte is. When discussing computer memory, most manufacturers use megabyte to mean 2^20 = 1 048 576 bytes, but the manufacturers of computer storage devices usually use the term to mean 1 000 000 bytes. Some designers of local area networks have used megabit per second to mean 1 048 576 bit/s, but all telecommunications engineers use it to mean 106 bit/s. And if two definitions of the megabyte are not enough, a third megabyte of 1 024 000 bytes is the megabyte used to format the familiar 90 mm (3 1/2 inch), "1.44 MB" diskette. The confusion is real, as is the potential for incompatibility in standards and in implemented systems."

Prof Russ Rowlett UNC:

"5 gigabytes (GB) should mean exactly 5 000 000 000 bytes, and 5 gibibytes (GiB) should mean exactly 5 368 709 120 bytes. The fate of this innovation is uncertain. So far, very few people are using the IEC binary prefixes. Searches for them on the Internet turn up, for the most part, complaints by people who don't want to use them."


"As of 2003, this naming convention has not yet gained widespread use. The IEC did not give names for the prefixes beyond exa-, but if they had given them names, they would probably be zebi- and yobi- as well as nobi- and dogbi-."

[Robelle] [SmugBook] [Index] [RISC] [Prev] [Next]