Jump to content

Solution to "memory leak"/RAM hogging, crashes, slowing computer down


DavidGGG

Recommended Posts

I've seen probably 30 posts on this subject or similar, so I might as well start a new one.

I found a solution that seems to work for me, or at least cause a great difference: Simply set the Windows swap file (also called virtual memory, or pagefile.sys in NT/XP/2000) to 0. I should mention that I use Windows 98 with 256MB RAM and 250kbit ADSL, but it might well be applicable for other Windows versions. I did one more thing though (see below, or it will crash).

The symptoms were: Slow system, crashes and that I couldn't run other programs smoothly in parallel with uT - for example if I tried listening to mp3 in Winamp, it was chopped all the time, and starting a program when uT was running took forever; even moving the mouse across the screen got slow in the end. If I stared at Windows' system tool with diagram of free memory and allocated memory, the numbers started out fine, but for every minute uT was active, allocated memory increased, eventually running wild at >370MB. Setting cache size manually in uT didn't help. Note: The only active program besides uT 1.6 was ZoneAlarm 6.1, and I have no devices or programs incompatible with uT (as listed on this site).

Details:

Maybe the apparent memory hogging is not the problem. It might seem strange (like memory leak) that used RAM increases all the time, and remains this high even after turning uT off, but that's just the way Windows works I think: RAM is there to be used, and swap file is treated like RAM.

The problem, I think, is that with swap file enabled, Windows will be close to using all available RAM all the time with a program like uT running. So what is seen is a huge amount of read/writes to the HD (swapping the swap file over and over).

I got a Windows crash shortly after I did the change. After that, I limited cache size manually in uT to 20MB (if you have more RAM than me and higher download speed, you might want to try a higher number), after that it's worked nicely.

You can observe how Windows RAM management works, if you start Windows with more or less only uT running, and add an already downloaded torrent for seeding and order uT the re-check it (if it doesn't do it automatically); this in my case makes it hog ALL memory within seconds (255MB allocated). Ending and re-starting uT now did not change this number. Now with uT running, start a few programs which consume a sizeable amount of RAM (I started Winamp and Firefox; try starting enough stuff to use all RAM). Note that they start fine, (and free RAM is the same as before even if you had used it all up). Also note that Winamp will run smooth as ever (even though free RAM might _appear_ to be very low). Shut the programs (Winamp+Firefox) down. Now you will have an amount of free RAM (the amount that Winamp and Firefox previously used). If you wait, uT will make the "free RAM" figure go towards 0 again, over time. So, it's no hogging, no memory leak, just a bad combination of a not-so-good SWAP file strategy with a program that keeps affecting RAM usage (maybe uT doesn't even use it deliberately, maybe it just happens, as uT sends requests to Windows; even opening a folder i Windows hogs 1MB which is not returned automatically afterwards, so I suppose the constant activity of uT might cause much unwanted activity in the Windows RAM swapping dept.) That's my theory anyway. An alternative theory is that the system tools do not display what I think they do.

I will try this out for a while, but it looks very promising. My computer also is much more silent now with the HD more at rest.. and I can look at video or whatever with uT running, no problem. Note: I have also disabled the power scheme which shuts down idle HD drives, don't know if it's necessary, I might turn it back on later, did it when looking for crash reasons.

Some people say it's not allowed to disable the swap file. To me a swap file should be needed only if program(s) need more RAM than you have. You might also try just setting the swap file manually (try 256MB for example), should reduce number of swaps a bit, but I don't think you will get a system behaving as mine is right now.

I would be interested to know what the drawbacks might be with this. Even if it should turn out not to be ok, this actions stills seems to affect the heart of the problem.

Hope this helps. uT is a great program (if thiw works).

//David (david.gothenburg@gmail.com)

Link to comment
Share on other sites

I'm also on Win 98 (Though to be precise, it's Win 98SE with all the official patches plus 98Lite/LitePC to remove extra/unneeded DLLs/exes).

In the C:\Windows folder, I've modified the system.ini file (it's a text file, best opened in notepad).

Under the

[386Enh]

section, I've added the 1 line:

ConservativeSwapfileUsage=1

Now, my swapfile is STILL managed by Windows. But so long as I have at least 100 MB of ram free, my swapfile size is almost always 0 bytes in size. Memory useage with this setting actually DECREASED even though everything was loaded into ram. (...unlike before, which parts were in the swapfile!)

Also in system.ini under

[vcache]

I added these values:

MinFileCache=40960

MaxFileCache=40960

ChunkSize=512

This means my ram cache for hard drive access is set to 40 MB min and max and a chunk size of 512 bytes. ...and I might get better performance if I up the chunk size to 1024 bytes.

Link to comment
Share on other sites

Thanks for the input. I followed your advise and you seem to be right! There's always tons of free RAM after those changes!

I should also warn that with swap file disabled, it worked like a charm for a day or so, but suddenly, while using uT + browsing, "vsmon" decided to crash. Everything else kept on working, but since vsmon is an essential part of Zone Alarm, I shut down quickly.. Can't say why this would happen because swap=0 but if ZA crashes it certainly aint good..

After that I tried fixed swap size (256MB), worked fine all day (Winamp didn't run as smoothly as before, but no crashes). But after downloading for 8 hours with uT, system got a bit slowish (even mouse etc). Don't know why, but seemed to be connected to when peers tried talking to my PC (maybe Zone Alarm activity is part of reason, I suppose it gets busy at those occasions anyway?). Should also say that with swap on manual, I have the possibility to select which drive it uses, and since I have 5 drives (C,D,E,F,G) of which C is rather swamped and lots of activity going on, it felt good forcing it to use a different drive; maybe that had some effect on stability as well.

I will try out this setup for a while, with your changes of system.ini, for now with fixed swap.

Link to comment
Share on other sites

No, have done some updates but heard of no pack. Do you know where it can be found (or the name of it)?

The system doesn't seem to crash anymore and RAM use is low, so I can't complain too much now. But still.. after having left the computer on for half a day, it is very.. "edgy" - things "half-hang" (windows refuse to close for ½ minute) etc. Reboot required twice daily. I guess it's my own fault for using Windows..

Thanks for valuable input anyway, without microTorrent and these fixes I would have had a hard time using P2P at all.

Link to comment
Share on other sites

  • 3 weeks later...

My ol' computer runs smoothly now: no crashes, no saggy mouse, nothing, and I can leave it on for a week or whatever, it just keeps going and going and...

I though I might post a detailed description of what I tried and what works for me, but for now I will just write down the main facts:

The number one thing to cause this difference is installing the Kerio 2.1.5 firewall (with BZ's rule set and a couple of minor bug fixes). Zone Alarm (free version anyway) is NOT working allright for me (I can't understand why it's not on the list of incompatible programs in the FAQ, since the moderators in some forums agree that it often causes problems). I also tried Jetico firewall, it worked better than Zone Alarm, but it's very hard to set up (and setting up a firewall is the main key to security, not for example how old the firewall is, like some seem to think). Kerio basically works in a way very similar to Jetico but with BZ's rule pack (found on some Kerio forum) and manual changes to allow DHT in uT, it is infinitely easier to use.

Another thing that caused much confusion is that the "System Monitor" included in Windows displays very incorrect values for CPU usage (and I don't trust the RAM usage values either)! Instead use "Process Explorer" by Sysinternals (found on microsoft.com) - it may for example show 5% CPU usage (which is correct) at the same time as "System Monitor" shows 80%!

Things I do NOT have to do to get this very stable system is: Tamper with the swap file and file cahce (as I and Switeck describe above), install the unofficial service pack (I tried it but didn't like some of the stuff forced upon me and the fact that I couldn't find any good description of what it does - I kept the Metapad replacement for notepad though!). I have used Win98SE in all these tests (since I wanted to get USB support if for no other reason) and I don't have to patch Windows with any updates for it to work (even though I of course added security updates later).

That's it for now. Just thought I'd report this before this thread is closed, in case someone has similar trouble. I have installed tons of programs by now and all works fine (at least no trouble with uT or Kerio involved).

I might post more details on this later (e-mail me at david.gothenburg@gmail.com and I will anyway), I can also describe setting up Kerio for dummies and mention other software that works good on Win98SE.

PS A warning regarding Jetico: I installed all my programs on a separate drive (including Jetico) and when uninstalling Jetico, it erased most of this drive!

//David

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...