Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I've heard people talk about deleting the swap file with autoexec.bat. I'm wondering if this is a good idea, or a bad idea. Why would you want to do this?

I am sure there might be some opinions flying around here. Here's mine: it is NOT a good idea to get rid of the swap file. The swap file is virtual ram -- when your system uses up all the ram available on your memory chip, the swap file takes over and grows and shrinks as ram is called for above and beyond what the chip provides, and then when the call isn't there, the file shrinks. I don't know about others, but I have 128 mb ram and I feel a squeeze with that. When a computer starts running out of memory, it starts having all sorts of problems running programs. Maybe people do it who have unsurpassable amounts of ram? But, if you work with graphics or music, you might want to be on the safe side and keep the swap file availabe. Hope this helps.

If my thinking is correct, deleting the swap file with autoexec.bat would basically result in starting with the swap file empty.
For some reason I think my swap file is hitting the "glass ceiling" and causing my system to lock up when there should be about 65% of the resources free. I'm using WIN98SE on a Dell Dimension with an Intel 850 with 128mb RAM and 16 GB free on the HD. When the system resources fall below 70% applications begin to fail, and I get messages saying that there is not enough memory available to launch applications (applications as small as Notepad). SYSMON reports that I'm only using 39k of 128k RAM, so I don't think that the issue is RAM. I think the problem is with the GDI stack, because the graphics are the first thing to go. This is crippling my computer to the point where I have to reboot about every 30 minutes!
If the swap file is deleted with autoexec.bat will Windows recreate it when it starts?
Any advice will be helpful!!

Windows will rebuild the swap file but if you drive is fragmented it might not help all that much.
That' why it might be best to set a fixed size unless it on a partiton that doesn't get fragmented.
As far as note pad goes it can only handle a certain size file before it reports low on memory.
You can open larger files with wordpad in most cases it does this by default.TheGorx
Windows Help

If you have more than one partition, defrag the partition with plenty of unused space.
Then go to Start/Settings/Control Panel/System, Performance tab, Virtual Memory, select Let me Specify my own virtual memory settings.
Select the partition that was just defragged and change the minimum size to 200mb and click on OK. You will be prompted to restart.Now if you go back there is looks as though it is back to Windows is back to managing the virtual memory although it is not.
You can leave it like this or you can then defrag your C:drive and change it back.
What all of this does is make the swap file a fixed size on a defragmented partition.
I have left mine as first stated and the only difference I see is after booting up and everything is loaded my hard drive stops making the noises much quicker because it is not resizing the swap file. Same is true after closing programs.
Note: If you have 64mb or less then make the minimum swap file 2.5 times larger but if you have 128mb or more then it does not really matter so 200mb (if you have wasted space) works fine.
Since you created the swap file on a defragged partition with a fixed size then you will never have to worry about it being fragmented.
(one man's considered opinion)

I set a fixed swap file (the minimum is the largest I will probably need but the maximum goes beyond that just in case) I leave it alone. I get no benifit erasing it on boot because it would ge fragmented quicker as would the drive resulting in slower access. I also see no point in erasing it. On a reboot it just overwrites the existing swapfile not keeping anything in it.
It will rebuild the swap file on reboot.
I could see a use in deleting it to defrag it:
1) Defrag the drive
2) reboot and delete the swap file
3) A new swap file gets created in a non fragmented space.

The GDI System Resources has nothing to do with the swap file! If you suspect the trouble is with GDI resources look elsewhere. Possibly an application with a problem.

Do a Ctrl-Alt-Del to see what's running after you boot. Any progs. you KNOW you can do without, disable them (probably running in SYSTRAY) or remove from Programs\Startup folder. Office 2000 FindFast for example, is a REAL resource soaker.

There's Hmmm again. (Hi! How are ya?) I'm running 98SE. Had this discussion with Tsjui(Sorry for the spelling, I'm sure it's not right) before, and he pointed out the same thing. At the time, based upon his "points", I had to agree. Well, I thought I'd try it again. I rebooted to (raw) DOS (I've got the boot menu running through MSDOS.SYS, picked option 5), and deleted my WIN386.SWP on my D: drive. (I've got three HDD's.) Rebooted (normal this time, ie; Windows), and the swap file was indeed re-built/replaced/re-installed/whatever you want to call it. (I powered down between boots, and let it sit for 45 seconds or so before re-powering.) Interesting. Is it because it's 98SE, & not just 98(FE)? I'd like to know. I jumped from 95_osr25 (build C) straight to 98SE. Idea's, thoughts?

Dan,
I'm not sure what your question is.On win95, without deleting the swapfile at the dos level, windows would recreate the file on every boot (if it was not a fixed file. MIN set).
On win98, the existing swapfile is always used by windows.
On both systems, if the file does not exist, windows will create one.

My response was based upon your post;
>On Win98, the previous one is used and thus is not rebuilt,On both systems, if the file does not exist, windows will create one.<So.... if it's deleted, it's rebuilt on bootup.
I'm not trying to nitpick here Hmmm, I just want to understand the topic at hand, (as Im sure Space Trucker (and maybe others?)) would. My "experiment" shows it is rebuilt. I just want to know is it because of "my system/version" that it is rebuilt, and will it ~not~ be rebuilt on some other o/s. (If I remember right, even 3.1 rebuilds it if deleted.)
As far as I understand the swapfile, it's ~generated~ at each bootup, and will start off based upon your settings, and grow and shrink as the "system" sees fit (again, based on your settings,) depending on what applications you're running. As far as I can see, you can safely delete it (don't see why you would though unless defragging), and not worry about it as the next boot rebuilds it. Am I missing something?

Something got jumbled in my last reply. When I was pasting it didn't seem to take it, then all of a sudden there was my paste, about six times down the "sheet". So then I deleted things to make it look right, and got the above when confirmed twice. Things are missing and truncated. Maybe I took too long typing. Try again tomorrow. It's late.

I've been using a separate partition for the swap file. It is set to 149Mb and the swap file is set to 148 for both min and max size, thereby making it a pemanent size and stopping Windows 98 from resizing it constantly. It has been working well with my 32Mb ram. I just installed 256Mb ram tonight and need to know if I should leave the swap file alone, change the size, or disable it. Does anyone know how a large amount of ram and the use of a swap file effect Windows 98SE?

Apart from the suggestions on Windows Resources (User/GDI) which is where the REAL problem lies. I'm not sure what is meant by "starting with the swap file empty". It's ALWAYS empty after a reboot!
Al (last post) - sounds like a good idea, doesn't it? Only problem with using a separate PARTION rather than DRIVE is that the HD heads will have farther to move to access the swap, and will actually degrade performance. With your 32MB RAM, you must use the swap file quite a bit.
I suggest what has been said. Defrag your main partition (with windows on it), and move the swap file back.

Dan:
The swapfile is ONLY "generated" at boot time IF
you are booting a win95 system
OR
you have deleted the swapfileOn a windows 98 system, the previous file is used.
Al:
Your swapfile may or may not be adequate. The best thing to do is to change the settings to eliminate the MAX. There are no benefits to setting an upper limit. This still creates a fixed contiguous swapfile the size of MIN that will get larger if required. If the MAX is set, and windows needs to grow the swapfile, you will get failures.
Monitor the size with SYSMON and adjust the MIN as necessary.

Hmmm; OK, that's what I wanted to clarify. If it's deleted, it's recreated. So, if someone wants to delete it, it's OK. (Again, I believe why bother, unless to defrag.) And as rambler stated, it's always empty (new) at each bootup, so there's nothing remembered or retained. If it's deleted (for whatever reason), you have a new one to start with at each bootup.

Well, the file is not really empty, primarily because it is NOT new. It is still the one from previous.
From Windows point of view, it it empty because everything is starting off at square one, and that is all that should matter.But from the files point of view, (only a worry to the real paranoic), there will still be pieces (4K chunks) of program code, dlls, etc inside the swapfile. The same as there is data lying around in most of your empty disk clusters, from previous files that have been deleted.
And deleting the file does not necessarily defrag it. If the swapfile has a MIN set, the file can't fragment to begin with (at least the portion under the MIN). If it is a windows managed swap, it is allocated in chunks of 4K.
So, it you defrag, then delete the file, odds are good that it might/will start to use its previous areas (which are now free as a result of being deleted), instead of the free area at the end of the drive (created as a result of the defrag).

![]() |
I Need Registry Key
|
Floppy Drive, no right cl...
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |