The most important factors in determining swap space size are the requirements of the system's software applications. For example, large applications such as computer-aided-design simulators, database-management products, transaction monitors, and geologic analysis systems can consume as much as 200-1000 Mbytes of swap space.
Consult your application vendor for swap space requirements for any application whose data files typically exceed 10-20 Mbytes in size.
If you are unable to determine swap space requirements from the application vendor, use the following guidelines to allocate swap space:
To support your applications, allocate:
1 Mbyte per trivial application such as xterm.
2-3 Mbytes per lightweight application such as a calendar or mail application.
20-50 Mbytes for large applications such as desktop publishing software.
To save crash dumps, allocate 100% of physical memory to save a worst-case crash dump.
If you are unsure of system or application requirements, allocate 50 to 100% of the system's physical memory. For example, allocate 16-32 Mbytes of swap space for a system with 32 Mbytes of physical memory. This will provide 48-64 Mbytes of total virtual swap space.
Determine whether large applications (like compilers) will be using the /tmp directory. Then allocate additional swap space to be used by TMPFS. See "Swap Space and the TMPFS File System" for information about TMPFS.