Changeset 10901


Ignore:
Timestamp:
Jun 27, 2010, 5:44:34 PM (12 years ago)
Author:
charles
Message:

(trunk libT) #3371 "experimental use of F_NOCACHE to ameliorate inactive memory on OS X"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/fdlimit.c

    r10814 r10901  
    400400#endif
    401401
     402#if defined( SYS_DARWIN )
     403    /**
     404     * 1. Enable readahead for reasons described above w/POSIX_FADV_SEQUENTIAL.
     405     *
     406     * 2. Disable OS-level caching due to user reports of adverse effects of
     407     *    excessive inactive memory.  However this is experimental because
     408     *    previous attempts at this have *also* had adverse effects (see r8198)
     409     *
     410     * It's okay for this to fail silently, so don't let it affect errno
     411     */
     412    {
     413        const int err = errno;
     414        fcntl( file->fd, F_NOCACHE, 1 );
     415        fcntl( file->fd, F_RDAHEAD, 1 );
     416        errno = err;
     417    }
     418#endif
     419
    402420    return 0;
    403421}
Note: See TracChangeset for help on using the changeset viewer.