In article <3ar8hg$ov6@loach.cichlid.com>, aab@cichlid.com (Andy Burgess) writes: >Does anyone know how to determine free swap space from C code on any of the >following platforms: > >dec: ULTRIX 4.4 I've seen two algorithms used: 1. You need to read the resource map for the "swapmap"�and then add up the size for each element. 2. There is a data structure called swapu, defined in . This keeps track of how the swap space is used. One of the fields is the total in use. The amount free is the total available - total_used. The amount available is the sum of sizes in swdevt table. Finally, ULTRIX keeps track of two things; the amount reserved and the amount in use. When a process wants virtual memory, it has to reserve the amount it wants. If there isn't enough available, then whatever was trying to get the memory gets ENOMEM or the equivalent. But, no space actually gets allocated, until the process wants to page. The number you want is probably the different in the total available and the amount reserved. Again, see . > > >Andrew A. Burgess aab@cichlid.com > -- Alan Rollow alan@nabeth.cxo.dec.com