Opened 5 years ago

Last modified 2 years ago

#5682 new Bug

Significantly increased memory usage over time on Windows

Reported by: Arpione Owned by: mike.dld
Priority: Normal Milestone: 3.00
Component: libtransmission Version: 2.82
Severity: Normal Keywords:
Cc:

Description

Operating system: Windows 7 64-bit Client version: 2.82 RAM: 4GB

I'm using Transmission-Qt Win, but according to it's dev this behavior is not caused by his modifications.

While seeding at 750KB/s the total memory usage (Transmisson's memory usage is normal) goes from 50% to 95-97% in about 20 minutes. If the speed is limited to 10KB/s the memory usage still grows, but it takes a couple of hours until it gets above 90%. As far as I know it's caused by the Windows disk cache, because the same bug was present in qBittorrent (and is present again, that's why I switched to Transmission). I made 2 screenshots of RAMMap, before and after closing Transmission after letting it run for some time:

before after

You can see the huge drop in memory usage in the Active column of the Mapped File row.

While this is technically a Windows feature, it renders the computer unusable because every running program gets swapped out of memory, causing serious slowdown.

Change History (3)

comment:1 Changed 4 years ago by mike.dld

  • Resolution set to invalid
  • Status changed from new to closed

See Microsoft KB article 976618 "You experience performance issues in applications and services when the system file cache consumes most of the physical RAM" for information on what's happening and how to deal with it.

In short, there is no way to control caching behavior on a per-file basis (except for disabling the system caching/buffering of file data altogether, which brings complications in the form of requirements for specially aligned and sized application buffers). What's recommended is to set system-wide settings for cache size. Sample service provided in the article ("Workaround" section), although designed for Windows version up to Server 2008, also works well for me (in a limited testing) on Windows 8.1 if built from source with system version check commented out.

If someone has an idea for a fix inside Transmission (except for calling SetSystemFileCacheSize, which is not going to happen), please reopen.

comment:2 Changed 2 years ago by mike.dld

  • Resolution invalid deleted
  • Status changed from closed to reopened

Looks like with Windows 8 / Windows Server 2012 Microsoft has added new set of APIs to manage memory priority per-process and/or per-thread: https://msdn.microsoft.com/en-us/library/windows/desktop/hh448387.aspx

Worth checking out I guess. We could probably set priority to MEMORY_PRIORITY_LOW or MEMORY_PRIORITY_MEDIUM or something around that.

Last edited 2 years ago by mike.dld (previous) (diff)

comment:3 Changed 2 years ago by mike.dld

  • Milestone changed from None Set to 3.00
  • Owner changed from jordan to mike.dld
  • Status changed from reopened to new
Note: See TracTickets for help on using tickets.