XTREE AND MEMORY

XTree uses conventional RAM memory, i.e. a maximum of 640 KB, both for its own operations and for storing information on the logged directories and files. A block of 32 bytes is used for each item logged, and thus the absolute maximum that can be logged at any one time is 640 x 1024 ÷ 32 or a little over 20,000 items. However, it is most unlikely that you will have all your conventional memory available, and in any case XTree sets aside a portion of memory for its own basic operations, so that the maximum number of directories and files that you will be able to log is probably under 14,000. And for many of its operations, such as viewing and archiving, XTree itself needs more than the minimum: memory equivalent to perhaps 5000 files. So in order to get the best use out of XTree you should try to keep the number of logged directories and files under 9000.

As hard disks and programs both get bigger, it is only too easy to exceed this limit. As I write this, my C: partition contains 7555 files in 194 directories, and the totals in four partitions amount to 397 directories and 12,543 files, a total of 12,940 items.

Another problem thrown up by this proliferation of files is time. XTree takes 7.5 seconds to log in the 7749 items on C: - and the disk is fast; a slow disk would take much longer.

Clearly ways of monitoring and managing this situation are needed. I will discuss monitoring below; managing will follow next month.

Monitoring Memory
One way to monitor available memory is of course to run MEM from inside XTree - always supposing that you have enough free memory to do so. But this is not necessary: hit X (eXecute) and the available memory is displayed. In my case, with all 12,940 items logged, there are only 45,072 bytes of RAM free and I cannot run MEM, or indeed any other program. With nothing logged but still inside XTree I have 469,744 bytes free. Problems are likely to arise if this figure falls much below 200,000 bytes.

Incidentally, do not forget that you can release memory used for logging to run a program by using Alt-X instead of X.

A much more direct way to monitor XTree's memory usage is to start the program with the Display Memory Usage switch, \XTGOLD\XTGOLD /XM. This will display a figure in both the Directories and Files screens, in the DISK box immediately above Available Bytes (on the same line as "Available"). This is the number of blocks (not bytes) available for logging, and will be seen to decrease by 1 for each directory and file logged.

This is the best way to monitor available memory, if only because the figure is visible almost all the time. Keep it above 6000 and you should have few memory problems.

Tom Ruben

up to XTree tips index