Jump to content

Memory leak bugs in 3.4.2 build 37477, 38463, 38803, 38913


duytrung

Recommended Posts

Hi all,
 
The program often display a message: Unable to allocate xxxxxxxxx byte of memory and require restarting the program.
 
There is about 23 dumps 25MB in the file attachment. http://sendfile.su/1093264
 
I have currently use the build 3.4.2_38913 but changed back to build 38707. I want to generate the processes list. However, I found that while build 38913 run, it cause the computer quite not responding.

 
Kind regards

Link to comment
Share on other sites

  • 4 weeks later...
Yes you are right daytrung, there is a bug in these later versions, but the same bug seems to keep appearing and disappearing from time to time and from versions to versions.

 

I've researched the topic thoroughly for several weeks, and i've seen also quite some drama threads on this forum where admins battle users when it comes to where the problem is and contrary to everyone's belief the problem is both in windows and in uTorrent.

 

Short Story is that uTorrent uses improper file open flags that causes windows cache to bloat and not release reserved memmory.

 

Now here's the long thorough version:

 

Symptom:

- Using uTorrent for long periods of time on 24/7 systems causes the memmory usage to bload to maximum memmory usage and slows down other applications.

- When you look in Task Manager you cannot identify what application is using it because it's not there.

- When you look in Resource Monitor you notice that whole memmory is marked as StandBy Memmory.

- Using [RamMap] shows that the memmory is used by MappedFiles cache. MappedFiles cache is windows's native file cache mechanic.

 

Cause:

- uTorrent has it's own caching mechanic built in. This means it has no need for windows cache. 

- However uTorrent does not implement the NO_Buffering_Flag on open file handles to bypass activation of windows cache, this means that windows caching will activate regardless.

- Because uTorrent never plans to use windows cache-ing is also does not account for proper file handle closing and release of the working set in order to release the cached files .

- This means that even after closing uTorrent those files will stay in the memmory until you reboot or clean the standby cache.

- Windows also has a faulty mechanic where by as long as the handle is open, or otherwise improperly closed it keeps that memory in use.

- Windows also does not know to trim/clear this memory after a certain time, or when other ACTIVE applications request it.

- Windows relies on the application itself to do proper disposing of handles. Which in my opinion is quite bad for an OS that wants stability.

 

Resolution:

 

uTorrent:

- Proper bypass of windows cache activation will prevent uTorrent from having this problem.

- If uTorrent wishes to also have the option of using windows cache it should implement it according to microsoft's cache usage standards.

 

Windows(Workaround):

- You can manually run [RamMap] and go to Empty -> Empty StandBy List. This will clear the cache, but it will build back up over time.

- Set up a task scheduler with the singlefile version for command line use - [EmptyStandbyList]  - Scan the file.Use at your own risk. This will empty the standby cache on run. You can set it up to run as a scheduled task on whatever interval you please.

- Complementary you can use [SetSystemFileCacheSize]  by Uwe Sieber to set a limit on the working set, however this will not limit overall usage, but it will limit the working set size.

 

I'm really curious about why this problem occures sporadically it might be that the code fails to activate it by mistake or that it's activated by mistake, in either case the versions are fairly incosistent in this problem.

Some uTorrent versions will exhibit this issue some will not.

 

For those interested in further study on windows file cache, here is a thead from the reputable sysinternals forums. [Here]

 

EDIT: Further testing shows that if you use [SetSystemFileCacheSize] and set up the limit to the working set, even though memory will still be cached to fill all free memory, it will no longer be seen as in use by the system and it allows other programs to consume that standby memory for it's use.

In normal operations cache should be a resource that can be cannibalized by actual applications and it should never show up as in use memory, however it seems that these recent versions of uTorrent the cache it creates appears as in use memory basically preventing other applications from forcing the cache to flush. That's why you get the "Ran out of memory errors and the system goes haywire."

I used setsystemfilecachesize\x64\SetSystemFileCacheSize.exe and set SetSystemFileCacheSize.exe off 4096 on a system with 32GB of RAM. Your system might differ, play around with what settings can fit your memory capacity.

This seems to directly limit the cache the uTorrent application can use, and mark incorrectly as in use. 4GB cache works for me.

EDIT2: Setting does not stick past reboots, you need to either make a Regedit entry in the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run with the entry ""PATHTOFOLDER\setsystemfilecachesize\x64\SetSystemFileCacheSize.exe" Off 4096"

Or find an alternative solution to have it run once on every boot.

 

 

Long term testing shows this does solve the cache problem.

Link to comment
Share on other sites

  • 2 weeks later...

Probably because the rest of the system is hogging it all.

The latest version 3.4.3 Beta build 39968 and some previous version start with build 38XXX has this bug. I believe that the bug is not by the system because I've used utorrent in the same system for long time. If it caused by the system, then the other previous verion could not work stably.

 

 

For the latest version at this time, when start-up, I found that the memory occupied by uTorrent program gradually built up to 1.5GB then it crashed. Every run take about 1hour and crashed. I made a search for same problem in the forum and found that some programs such as ZoneAlarm, or Nvidia Network Access Manager interfere with the performance of utorrent. However, I don't have those program installed. and I have tried to set the windows to "system cached mode".

 

The bug might caused by the program. not the machine.

Link to comment
Share on other sites

 

Yes you are right daytrung, there is a bug in these later versions, but the same bug seems to keep appearing and disappearing from time to time and from versions to versions.
 
I've researched the topic thoroughly for several weeks, and i've seen also quite some drama threads on this forum where admins battle users when it comes to where the problem is and contrary to everyone's belief the problem is both in windows and in uTorrent.
 
Short Story is that uTorrent uses improper file open flags that causes windows cache to bloat and not release reserved memmory.
 
Now here's the long thorough version:
 
Symptom:
- Using uTorrent for long periods of time on 24/7 systems causes the memmory usage to bload to maximum memmory usage and slows down other applications.
- When you look in Task Manager you cannot identify what application is using it because it's not there.
- When you look in Resource Monitor you notice that whole memmory is marked as StandBy Memmory.
- Using [RamMap] shows that the memmory is used by MappedFiles cache. MappedFiles cache is windows's native file cache mechanic.
 
Cause:
- uTorrent has it's own caching mechanic built in. This means it has no need for windows cache. 
- However uTorrent does not implement the NO_Buffering_Flag on open file handles to bypass activation of windows cache, this means that windows caching will activate regardless.
- Because uTorrent never plans to use windows cache-ing is also does not account for proper file handle closing and release of the working set in order to release the cached files .
- This means that even after closing uTorrent those files will stay in the memmory until you reboot or clean the standby cache.
- Windows also has a faulty mechanic where by as long as the handle is open, or otherwise improperly closed it keeps that memory in use.
- Windows also does not know to trim/clear this memory after a certain time, or when other ACTIVE applications request it.
- Windows relies on the application itself to do proper disposing of handles. Which in my opinion is quite bad for an OS that wants stability.
 
Resolution:
 
uTorrent:
- Proper bypass of windows cache activation will prevent uTorrent from having this problem.
- If uTorrent wishes to also have the option of using windows cache it should implement it according to microsoft's cache usage standards.
 
Windows(Workaround):
- You can manually run [RamMap] and go to Empty -> Empty StandBy List. This will clear the cache, but it will build back up over time.
- Set up a task scheduler with the singlefile version for command line use - [EmptyStandbyList]  - Scan the file.Use at your own risk. This will empty the standby cache on run. You can set it up to run as a scheduled task on whatever interval you please.
- Complementary you can use [SetSystemFileCacheSize]  by Uwe Sieber to set a limit on the working set, however this will not limit overall usage, but it will limit the working set size.
 
I'm really curious about why this problem occures sporadically it might be that the code fails to activate it by mistake or that it's activated by mistake, in either case the versions are fairly incosistent in this problem.
Some uTorrent versions will exhibit this issue some will not.
 
For those interested in further study on windows file cache, here is a thead from the reputable sysinternals forums. [Here]
 
EDIT: Further testing shows that if you use [SetSystemFileCacheSize] and set up the limit to the working set, even though memory will still be cached to fill all free memory, it will no longer be seen as in use by the system and it allows other programs to consume that standby memory for it's use.
In normal operations cache should be a resource that can be cannibalized by actual applications and it should never show up as in use memory, however it seems that these recent versions of uTorrent the cache it creates appears as in use memory basically preventing other applications from forcing the cache to flush. That's why you get the "Ran out of memory errors and the system goes haywire."
I used setsystemfilecachesize\x64\SetSystemFileCacheSize.exe and set SetSystemFileCacheSize.exe off 4096 on a system with 32GB of RAM. Your system might differ, play around with what settings can fit your memory capacity.
This seems to directly limit the cache the uTorrent application can use, and mark incorrectly as in use. 4GB cache works for me.
EDIT2: Setting does not stick past reboots, you need to either make a Regedit entry in the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Run with the entry ""PATHTOFOLDER\setsystemfilecachesize\x64\SetSystemFileCacheSize.exe" Off 4096"
Or find an alternative solution to have it run once on every boot.
 
 
Long term testing shows this does solve the cache problem.

 

Thanks X3style for your comment. I'm really interested in install or arm my computer with heaps of additional program. I found that if the latest stable one is not stable for daily use I will consider switch back to the elder version (downgrade) or use another client if necessary. My system is old with 4gb of ram. I don't know if I make tweaks as in your instruction the system will be better or not. So let's see how things are going.

 

The more speedy uTorrent, the faster it crashes! As memory will build up faster and when it reach to ~1.5 GB it crashes. I just don't want to sit with my computer all the time and refresh its cache manually or something like that. It's not the nature of torrent user that left the computer to pull down stuffs from the internet in automatically as downloads could take one, two, or more days to complete and utorrent will always run at it should be.

 

Kind regards

Link to comment
Share on other sites

  • 1 month later...

Thanks x3style, that is exactly the same issue i've observed. I updated utorrent the other day to version 3.4.3 build 40298 and started encountering this issue with 8 gb of memory. It takes somewhere between 12-24 hour before it eats all my ram. The easiest solution for me is to just stop all my torrents and then restart them. Rather than mess around with cache limits, i'm going to try reverting back to a previous version as soon as I can find a safe copy (which apparently isn't supported here).

Link to comment
Share on other sites

I've also observed all my RAM gradually increasing in usage (I have 32GB) with 3.4.3 build 40298 (previous builds it does not happen for me). RamMap shows that it is some 300-400 files I am seeding (all large video files) that are never released until I exit uTorrent - climbing at a rate of 200-400MiB per 30 minutes.

SetSystemFileCacheSize worked for me.

Bittorrent Inc staff: Please refer the devs to implement the FILE_FLAG_NO_BUFFERING flag.

https://msdn.microsoft.com/en-us/library/windows/desktop/cc644950(v=vs.85).aspx

Windows 8.1 Enterprise x86-64

Asus Maximus IV Extreme-Z

i7-2600k OCed to 4.2gHz

Issue persists when using default settings (moving settings.dat and allowing it to generate a new one with default settings).

Through my use of a debugger I can confirm what x3style said above is true. It does not disable Windows' cache properly.

Further information: https://msdn.microsoft.com/en-us/library/windows/desktop/aa364218(v=vs.85).aspx

Link to comment
Share on other sites

Came to the forum after having the same problem.   I could not work out why I had 95% memory usage while no program was using a lot of memory.   The only thing I'd changed on my system was upgrading utorrent to latest version.   Used rammap and noticed 5gb of ram was mapped files.   Soon as I close utorrent half my system ram becomes available again.    System becomes slow and hangs if i do not close utorrent. 

 

 

Never had this issue in 3.4.1 soon as upgrading to 3.4.3 stable and also latest beta.    Like others have said utorrent is causing some bug with windows cache system.  Hope it gets fixed soon.  Im using latest windows 7 64bit.   Gonna downgrade to 3.4.1 till fixed. 

Link to comment
Share on other sites

  • 2 weeks later...

Thanks x3style, that is exactly the same issue i've observed. I updated utorrent the other day to version 3.4.3 build 40298 and started encountering this issue with 8 gb of memory. It takes somewhere between 12-24 hour before it eats all my ram. The easiest solution for me is to just stop all my torrents and then restart them. Rather than mess around with cache limits, i'm going to try reverting back to a previous version as soon as I can find a safe copy (which apparently isn't supported here).

Just an update. I reverted back to Utorrent 3.4.1 Build 31227 and can confirm the issue does not happen on this version. Memory usage stays even with the same number of (or more) active torrents.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...