>Hi All,
>
> I would like to know about windows Swap file structure. What type of information windows stores in swp file.
The swap file is used to provide virtual memory; it's used to emulate RAM, so that applications that require more memory than is physically available on the system don't fail. Portions of physical memory in 4K pages are moved to and from disk in the swap file on an on-demand basis; memory content that is not being actively referenced is eligible to be moved temporarily from RAM to disk to free up space for other blocks of memory. As non-resident data is referenced, it is swapped back into RAM by the operating system.
There is no standard file 'format' to play with; if you need much greater details, try something like Oney's
Systems Programming for Windows 95 or Richter's
Advanced WindowsThe swap file is also used extensively for interprocess communication (OLE/ActiveX/DDE/Memory Mapped Files, etc.). The swap file is used even if there's more than enough physical RAM for a number of reasons.
>
> Whenever i load any application, Swap file size get increases. and if i write something, it creates .tmp file in temp directory.
The swap file is being enlarged to provide additional virtual memory; the .tmp file is not a part of the swap file, and is probably being created as an intermediate step in something your application does. Unless you're specifically creating the .tmp files yourself, most apps will clean up their .tmp files if they terminate normally.
You can rduce swap file activity, and in all likelihood improve your performance significantly by adding more RAM to the system; if the swap file is being enlarged whenever you start an application, it's an indication that there isn't enough physical RAM in the system to host everything you need (operating system, applications, active data, etc. all require memory.) if you have a great deal of swap file activity, that's an indication that things are being moved in and out of RAM frequently; it affects the overall system performance dramatically.
No matter how much physical memory you have, don't disable virtual memory; the swap file is used for things other than virtual memory, and things like the Clipboard and out-of-process Automation servers don't work well at all without the swap file.