GetSystemFileCacheSize function (memoryapi.h)

Retrieves the current size limits for the working set of the system cache.

Syntax

BOOL GetSystemFileCacheSize(
  [out] PSIZE_T lpMinimumFileCacheSize,
  [out] PSIZE_T lpMaximumFileCacheSize,
  [out] PDWORD  lpFlags
);

Parameters

[out] lpMinimumFileCacheSize

A pointer to a variable that receives the minimum size of the file cache, in bytes. The virtual memory manager attempts to keep at least this much memory resident in the system file cache, if there is a previous call to the SetSystemFileCacheSize function with the FILE_CACHE_MIN_HARD_ENABLE flag.

[out] lpMaximumFileCacheSize

A pointer to a variable that receives the maximum size of the file cache, in bytes. The virtual memory manager enforces this limit only if there is a previous call to SetSystemFileCacheSize with the FILE_CACHE_MAX_HARD_ENABLE flag.

[out] lpFlags

The flags that indicate which of the file cache limits are enabled.

Value Meaning
FILE_CACHE_MAX_HARD_ENABLE
0x1
The maximum size limit is enabled. If this flag is not present, this limit is disabled.
FILE_CACHE_MIN_HARD_ENABLE
0x4
The minimum size limit is enabled. If this flag is not present, this limit is disabled.

Return value

If the function succeeds, the return value is a nonzero value.

If the function fails, the return value is 0 (zero). To get extended error information, call GetLastError.

Remarks

To compile an application that uses this function, define _WIN32_WINNT as 0x0502 or later. For more information, see Using the Windows Headers.

The FILE_CACHE constants will be defined in the Windows header files starting with the Windows SDK for Windows Server 2008. If you are using header files from an earlier version of the SDK, add the definitions shown in SetSystemFileCacheSize to your code.

Requirements

Requirement Value
Minimum supported client Windows Vista, Windows XP Professional x64 Edition [desktop apps only]
Minimum supported server Windows Server 2008, Windows Server 2003 with SP1 [desktop apps only]
Target Platform Windows
Header memoryapi.h (include Windows.h, Memoryapi.h)
Library onecore.lib
DLL Kernel32.dll

See also

Memory Management Functions

SetSystemFileCacheSize