Changeset 10928


Ignore:
Timestamp:
Jul 2, 2010, 12:48:49 PM (12 years ago)
Author:
charles
Message:

(2.0x libT) #3371 "Use F_NOCACHE to reduce the growth of Inactive Memory on OS X" -- added

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/libtransmission/fdlimit.c

    r10676 r10928  
    395395#endif
    396396
     397#if defined( SYS_DARWIN ) 
     398    /**
     399     * 1. Enable readahead for reasons described above w/POSIX_FADV_SEQUENTIAL.
     400     * 2. Disable OS-level caching due to user reports of adverse effects of
     401     *    excessive inactive memory.
     402     * It's okay for this to fail silently, so don't let it affect errno
     403     */
     404    {
     405        const int err = errno;
     406        fcntl( file->fd, F_NOCACHE, 1 ); 
     407        fcntl( file->fd, F_RDAHEAD, 1 ); 
     408        errno = err;
     409    }
     410#endif
     411
    397412    return 0;
    398413}
Note: See TracChangeset for help on using the changeset viewer.