In case of WinXP. Right click on My Computer, then advanced>performance>settings>advanced>under virtual memory click on change button and then change the size accordingly.
In case of Win98. Right click on My Computer>Performance>Virtual Memory & then change it accordingly.
Though WinXP is good in virtual memory, Win98 does need some tweaking. It is a good idea to make a swap file of 2.5 times the size of the system RAM.