Managing Virtual Memory
Optimise a basic operating system
Managing virtual memory 2
Virtual memory in different types of operating systems 2
Optimise the system to meet organisational requirements 8
Windows XP 8
Disk management (file systems) 12
Changing file systems 12
Managing storage 13
Disk management (disk errors) 14
Disk optimisation (defragmentation) 16
Linux system tools 18
Software updates 20
Third party tools 23
Summary 24
Check your progress 24
Managing virtual memory
An operating system, to run efficiently, will often need more physical memory (RAM) than is inserted on the motherboard, so that it can simultaneously run multiple applications. Remember that operating systems like the newer versions of Windows, Linux, and Macintosh are multi tasking operating systems, capable of running many applications at any one time. So, the less memory your computer has, the worse the performance. This problem can be overcome by using virtual memory. This works in the following way.
When RAM becomes full, the operating system moves data that is not immediately required onto a reserved area of the hard disk. This is called swapping or paging. It gives the appearance of more memory by using some of the space on the hard disk to temporarily store pages of information.
Windows stores this information in a special file called the swap file (Windows 95/98/ME) or the paging file (Windows 2000 and Windows XP) and in a swap partition on Linux. (Note that Linux does allow you to create an extra swap file on a hard drive providing you have enough disk space.) Also note that the Microsoft definition of virtual memory is a combination of both physical RAM and the swap file.
In Microsoft Windows operating systems, this file is a temporary file that is created every time Windows is started and it is deleted when you shutdown. This process becomes more efficient when the hard disk is optimised and there is sufficient free disk space for this process to occur.
Virtual memory in different types of operating systems
Microsoft recommends that the minimum size for this file is 1.75 times the RAM size. This is for computers with memory up to 128 MB. For 256 MB or higher, the file should be the RAM size plus 12 MB. Never set the minimum page size smaller than physical memory as this can cause Windows to stop functioning. The maximum size can be set virtually as high as you like (up to your physical disk size) because Windows expands the file as needed.
Linux recommends that the swap partition should be at least twice the size of physical RAM.
Windows XP
You can specify these settings in Windows XP as follows:
1 Select the Control Panel’s System icon
2 Select the Advanced tab
3 Click Performance & Settings
4 Under Advanced, Virtual Memory section, click Change.
[pic]
Figure 1: XP virtual memory settings
The existing (default) settings are usually fine. You might increase the initial and maximum size if you are often using programs with large memory requirements, (such as shared databases). Note however, that increasing physical RAM size will definitely give even better performance increases in such cases. Be aware, however, that motherboards generally have a limit in the amount of physical RAM that can be installed. You should check your motherboard manual for this value.
Linux
Linux uses a complete partition for swapping and it is ‘set up’ during the install process. Therefore, it is difficult to change the size of the swap file in Linux, on one hard drive, without physically reinstalling the operating system and changing the size of the partition. You can, however, create another swap file, along with the existing one, if you were to install a new hard drive.
To create an extra swap file, this is generally done by using the command line, with the dd command. So to create a 128 Mb file, you might have this command, as given below. (Note the source for this information was found (in part) at the Linux tutorial website at:
Command to create an extra swap file
dd if=/dev/zero of=/data/swapfile.1 bs=1024 count=131072 which displays: 131072+0 records in 131072+0 records out.
dd command = converts and copies a file.
if = the Input File, in the case from nothing.
of = Output File, in this case creates on the data volume called swapfile.
1 bs = no of bytes.
Count = 131072. If you divide this number by 1024, it equates to 128 Mb.
Next you have to prepare the file for usage as swap space using the mkswap command. The simplest form would be:
mkswap device size
Where ‘device’ is either the name of a hard disk partition or the name of a file you want to create. The ‘size’ option is only required when you create a swap file.
So if you type the following command:
mkswap/data/swapfile.1
It displays:
‘Setting up swapspace version 1, size = 131072 Kb’
This will format the swap space by adding the appropriate header information.
Once it is created, it needs to be activated. The above command can be used to create a temporary swap file. If you want to have it activated as a permanent swap file on boot up, you need to add information to a boot file called fstab. This file is usually found in the /etc directory. You need to add a new disk drive name. Drive names in Linux are not identified as C: or D: as they are in Windows, but by a device name. So the command line, in the fstab file would be:
/dev/hda3 swap swap
which basically says that the device/dev/hda3 is to be mounted onto the special mount point called swap, and is of type swap.
Practice 1
If you have access to a Linux system, run the commands ‘man dd’ and ‘man mkswap’ at a command prompt. This will run the online help manual pages for the two commands and it shows the options available for the commands.
Practice 2
On your computer system, determine the current settings for virtual memory. Note do not change anything.
Windows 95/98/ME:
Access virtual memory in Windows 95/98/ME via the start menu.
Start->Settings -> Control Panel -> System -> Performance tab -> Virtual memory
Windows XP
Start -> Control Panel -> System -> Advanced -> Performance & Settings
-> Advanced -> Virtual Memory -> Change
Linux
Login to the command prompt and type the command ‘free’ (without the quotes).
Feedback
Here are the virtual memory settings windows in different operating systems.
Windows 98
Note that the recommended setting is to allow Windows to manage the virtual memory. This is usually a good idea.
[pic]
Figure 2: Windows 98 virtual memory
Windows XP
[pic]
Figure 3: Windows XP virtual memory
Linux swap file information
[pic]
Figure 4: Linux swap file
It is not recommended that virtual memory settings be ‘played with’ for your computer system. It may cause your system to stop responding. If you have access to a trial computer system on which you can change settings, then adjust some of the settings and watch the outcome. If you set values too small, you may find on reboot that the system is very sluggish, or may not work at all. Set them too big and the available free space on your hard disk will shrink, but you may not notice a measurable improvement in the system performance.
Optimise the system to meet organisational requirements
Now we will look at specific tools in different operating systems. Remember that similar tools are available in most operating systems, although you may find that the name of the tool is different, or the screen shown is different. In some cases the operating system you are using simply may not have an equivalent tool.
Windows XP
In Windows XP some of the tools for monitoring system optimisation and performance can be found in the Computer Management Console from within the Control Panel.
To be able to use these tools you may find that you have to be logged on as the computer administrator.
[pic]
Figure 5: Administrative Tools
If you double-click the Administrative Tools icon, the following options (below) are displayed.
[pic]
Figure 6: XP Administration Options
If you double-click the Computer Management icon the following optimising options are available:
• Event Viewer
• Shared Folders
• Performance Logs and Alerts
• Disk Management.
[pic]
Figure 7: XP Computer Management
Event Viewer
The Event Viewer displays events happening, or have happened, on your computer. This can help to diagnose problems that may be occurring or about to occur, particularly during start-up. You often get a message box indicating that a service failed to start during start-up and are directed to Event Viewer to get details. Periodic review of the information in the Event Viewer logs is important to discover trends that may affect system performance adversely. Event Viewer has three types of logs:
1 Application Log, which shows information about applications programs
2 Security Logs, which can identify is any security breach has occurred
3 System Logs, which displays information about any specific system events that has happened on the computer.
You should check these logs on a regular basis to try to avoid any potential problems.
[pic]
Figure 8: XP Event Viewer
Shared folders
Shared folders allow you to share various resources on your computer with other users of your network. This area of control panel shows the folders, printers, etc that you have shared on your computer. Note that you cannot create or disable a share from here, it will only display the shares on your computer. If you want to create, modify or delete the shares, you do this from Windows Explorer or My Computer.
[pic]
Figure 9: XP Shares
Device Manager
The Device Manager in Control Panel displays those hardware devices that the computer is aware of. It can also show if there are any devices that have a problem with configuration. It will also show information on each of the devices. It may be possible, depending on the device, to configure it to work better by changing a setting, etc.
[pic]
Figure 10: XP Device Manager
Performance Logs and Alerts
Performance Logs and Alerts supports detailed monitoring of the utilization of operating system resources.
[pic]
Figure 11: XP Performance Logs and Alerts
Disk management (file systems)
The file system refers to the method of file storage used on a hard disk, and is determined when formatting a disk. Some operating systems permit the user to select a file system only during installation.
Microsoft file system formats include:
• FAT (File Allocation Table) for DOS or earlier Windows 95 versions. FAT or FAT16 allows a maximum size of a volume to be about 2 gigabytes, which means that you have to create many drive letters on currently available hard disk drives, because of their size.
• FAT32 (File Allocation Table 32bit) for Windows 95/98/ME/XP is a more efficient version of the older FAT that can allow larger volume sizes to accommodate the larger hard disk drives available now.
• NTFS (NT File System) is a more secure and robust file system for Windows NT/2000/XP. It provides strong security for file access between users of the same computer and recovery capabilities.
Changing file systems
Many operating systems require a file system to be reformatted in order to change the file system type. Even if you can change the file system type, your computer will not be available for use until the conversion is complete.
During the installation of Windows XP you are given the option to use (or keep) a FAT file system in order to allow a dual-boot system, perhaps to be used during a pilot installation or trial change over period. To improve security on the computer systems in your organisation you may be required to convert from FAT or FAT32 to NTFS. Microsoft provides a command line tool to perform this conversion within Windows XP. Note that a volume converted in this way may not perform as well as one which has used NTFS from the time of installation. Also, conversion is a one-way process. You cannot convert back from NTFS to FAT32.
At the command line (Start->Run) you would type:
convert volume:/fs:ntfs/v
but replace the word volume with the drive letter you are going to convert to NTFS. The /v is optional and runs convert in ‘verbose’ mode which means that you are given more information about what is happening during the conversion.
In Windows 98/ME there is a utility called Drive Converter to convert the file system from FAT to FAT32. (Start->Programs->Accessories->System Tools->Drive Converter)
Research
Windows in-built Help is a great source of information about your computer. Read more about file systems there.
Managing storage
Windows XP also gives you advanced control over your storage systems. By selecting Disk Management from within Computer Management, you can set up drives, see the ‘health’ of existing drives, change drive letters, format drives and check the properties of the drives.
[pic]
Figure 12: XP Disk Management
Practice
Access and view the storage management settings on your own computer. Remember that many of the options in Computer Management require you to be logged on as Administrator.
The context-sensitive help screens in Windows provide you with more information about these tools. From anywhere within the Computer Management Console, press . Read the information provided about disk management. Similarly, access this help information as you proceed through the following sections.
Disk management (disk errors)
A disk or file system may develop errors for a number of reasons including power failures, drive wear and poorly written programs. Operating systems tend to provide utilities or tools to detect such errors and repair them if possible, or mark them as unusable. These programs usually detect physical problems as well as logical structure errors, such as lost clusters, cross-linked files or directory errors. These three problems occur when the system tries to write out files to systems that have problems and sometimes ‘get lost’ on the hard drive (that is, there are no entries in the File Allocation Table for all, or parts of, files).
Windows 95/98/ME
Windows 95/98/ME provides a utility called Scandisk that has both text and GUI versions. The text mode version is run automatically during start-up if the file system was not properly shutdown. The GUI version can be run from the Start menu (Start->Programs->Accessories->System Tools->Scan Disk).
Windows XP
Windows XP does not install Scandisk in the System Tools folder, so to work with a GUI version you must do the following:
1 Open My Computer.
2 Right-click the drive you want to check.
3 Select Properties from the pop up menu.
4 Click Tools.
5 In Error-checking click on Check Now to start the checking procedure.
[pic]
Figure 13: XP Error Checking
Windows XP also provides a command line tool called chkdsk (check disk). You use chkdsk to also scan and repair volumes on the hard disk drive. You must be logged on as Administrator prior to running chkdsk as follows:
Choose Start->Run
At the command line, type the following: chkdsk volume:/f
Replace the word volume with the drive letter you are going to check. The /f is optional, but without it chkdsk will only report errors it finds not fix them.
[pic]
Figure 14: XP ChkDsk
Practice
Run the check disk program on the computer you are using. Try it first without the /f , then with it.
Run the program on other drives if they are available.
There are many options for check disk. Try chkdsk/? to display them.
Disk optimisation (defragmentation)
The fragmentation of a file system is caused by normal use. As files of different sizes are created, modified, moved and deleted the storage locations on a disk are left with various sized holes, and files are not stored continuously on the disk. This is known as fragmentation. Normal functions of a computer system such as browsing the Internet or working on word processing documents cause this fragmentation. Fragmentation has a detrimental effect on the performance of an operating system and can in fact cause a hard drive to ‘crash’.
While the standard FAT file system, FAT16 from DOS or FAT32 from Windows 95/98 benefit from occasional defragmentation, NTFS benefits from much more frequent use of a defragmentation tool. Microsoft suggests weekly or even daily use depending on certain factors. You may even decide to schedule the defragmentation tool to run automatically to reduce administrative workload and keep the operating system optimised.
In the storage node of the Computer Management Console there is a snap-in (leaf or link) called Disk Defragmenter. This tool is used to report on the level of fragmentation and rearrange the files on the disk to remove this fragmentation.
[pic]
Figure 15: XP Defrag
Defragmenting the file system will result in faster file and directory access and so increase the system speed for the users. Disk optimisation in this way overcomes these fragmentation problems by doing two things:
1 It defragments files — this is the process of moving files around so that all of the data from a file is located together.
2 It removes gaps of unused disk space — this is the process of maximising usage of the disk.
Because the files and directories are now located together and also at the beginning of the disk, disk access time is reduced (the Read/Write heads do not have to travel as far to retrieve data) therefore the system will be a lot more responsive.
The image below shows the defrag tool at work. Note the two coloured displays. They are the ‘before’ and ‘after’ snapshots. Basically fragmented files are in red so you want to end up with a file system which is mostly blue for contiguous files and white for free space. System files are indicated by green areas, and they will not be moved.
[pic]
Figure 16: XP Defrag at work
Some red areas in the figure above will not be moved, probably due to them being files currently in use, or are stored specifically in a cluster on the hard drive and will not ever be moved, such as the system swap file. For this reason, to achieve best results, defrag should be scheduled for times when the system is not being used. This is also important since the defrag process takes up considerable system resources and may take a long time.
Microsoft also recommends that you maintain about 30 percent of any NTFS-formatted disk as free space to ensure that you have sufficient room for effective defragmentation.
Practice
The Windows computer you are using now will have a defragmentation tool. When you have finished working for the day, shut down all of your programs and start the defragmentation tool. If it has a detailed display, watch and see if you can identify the actions it is taking. It is interesting (for a while, at least) to watch the defrag tool, move files from one area to another, then move other files into the gaps made by the first move.
Linux system tools
Many of the system tools with Linux are accessed from the command line. Shown below are a few of the tools that can be accessed via the X Windows system. You will notice that they strike a resemblance to some of the windows tools mentioned previously.
Control Panel
As with Windows XP, Linux has a control panel (called preferences) that has various options for configuring and optimising the system.
[pic]
Figure 17: Linux Control Panel
Log files
Linux has many log files that can be accessed. As with any computer system the log files should be accessed and checked on a regular basis to try to determine if the system has any problems looming, if there are any security breaches, etc.
[pic]
Figure 18: Linux logs
Linux System Monitor
The System Monitor can show the status of the Linux system. Again, this can help to optimise the system. For instance, if the CPU usage is peaking at a constant 100%, this could indicate a runaway process.
[pic]
Figure 19: Linux Device Manager
Linux Hardware Browser
The Hardware Browser is similar to the Device Manager in Windows. From here you can change some items and configure others for best optimisation.
[pic]
Figure 20: Linux Hardware Browser
Software updates
From time to time, operating system vendors such as Microsoft release updates for system and application software. The updates often fix bugs and security issues so it is important to implement them. Some sources suggest that most Internet attacks will be through known flaws in operating system security that have not been patched by available updates.
Microsoft updates
You can update your system software in Windows XP by using the Windows Update facility available as a shortcut from the Start menu to the Windows Update server on the Internet. If you do not have access to the Internet from the system you want to update then you need to manually download fixes, patches and service packs and install each of them. Other vendors may supply CDs or floppy disks that also have to be installed manually. However, most supply access to updated or improved drivers and patches over the Internet. An increasing trend is to include options for automatic upgrade/installation, such as updating virus definition files. The service pack level for Windows XP, as at December, 2004, is SP2. This is a major service pack release of well over 250 Mbs and (is supposed to) fix many security vulnerabilities within Windows XP.
However, if you have regular access to the Internet, there is a feature within Windows XP, to automatically download all the latest fixes.
To check the Update selection from within Windows XP go to: Control Panel, System icon, Automatic Updates tab.
From here you can enable the system to automatically install the updates, or it will prompt you before installing them.
[pic]
Practice
Locate and select the Windows Update shortcut within the Start menu of whatever Windows version you are using. (If Win98: Start->Settings->Windows Update). Allow the Update Wizard (manager) to connect to the Windows Update server and analyse your system’s update requirements.
Record what updates are available for your system. Are there any listed which sound as if they would correct any problems you are having? What about security updates? You don’t need to download them now but be aware that these are available if you are having the problems described or even to make your system as secure as possible.
Note you can also go to the Microsoft website and have this website automatically scan your system. You can find this service at:
Feedback
The Windows Update Wizard (Manager) requests information from the update server. It then compares the list with the installed updates on your system and provides you with the list of new updates that are available. They are sorted into categories based upon how critical to system performance and security they are. You can then select to update all or some of the areas listed.
Linux updates
Linux allows you to connect to a Redhat server and download the latest patches and fixes. The two screens below show the service and the configuration options. Note that you may have to join a subscription service that charges.
[pic]
Figure 22: Update Manager
Third party tools
There are also various businesses that supply third party tools that can optimise your system. You can use Internet search engines and find tools that will suit your particular system. As an example, a company called Norton’s release a suite of programs called Norton Utilities, that include various tools for optimising your system:
• Norton System Doctor monitors your system in the background and can interrupt specific programs that may cause a system crash before the crash occurs. It can then fix them or isolate them.
• WinDoctor can diagnose and repair common windows problems to maintain a system at peak efficiency.
• Disk Doctor is an alternative to Scandisk and ChkDsk.
• Speed Disk can defrag and optimise file systems for peak performance.
Practice
Use the Internet and search for ‘optimisation tools’ for the operating system you are using. If any seem relevant to a particular problem you are having, then apply them to see the effects. Be aware, however, that any optimisation must meet the users’ and the organisation’s requirements.
Summary
In this reading we have looked at some of the system tools that enable you to perform system optimisation on specific operating systems. As well, we have looked at automatic update facilities to keep the system secure and performing at its optimum level.
Evaluating system performance and updating software should be included in your installation plans and schedules. We have looked at various system tools required for performance monitoring and identified areas where performance increases are possible. Here, we looked at the following tools:
• administrative tools
• system tools
• event viewer
• system information
• services
• run check disk
• optimising (defragmenting) a disk
• changing virtual memory settings
• updating the system software.
Check your progress
Now you should try and do the Practice activities in this topic. If you’ve already tried them, have another go and see if you can improve your responses.
When you feel ready, try the ‘Check your understanding’ activity in the Preview section of this topic. This will help you decide if you’re ready for assessment.
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.
Related searches
- virtual memory management in os
- linux virtual memory management
- what is virtual memory management
- virtual memory in os pdf
- virtual memory in os
- virtual memory in computer architecture
- virtual memory in operating system
- windows 10 virtual memory setup
- virtual memory tutorial
- best virtual memory windows 10
- how to set virtual memory windows 10
- view virtual memory windows 10