CLlmClient::GetMemoryUsage Method  
 
BOOL GetMemoryUsage(
  PLARGE_INTEGER lpMemUsage  
);
BOOL GetMemoryUsage(
  LONGLONG *lpMemUsage  
);

The GetMemoryUsage method returns the number of bytes of memory allocated for the client session.

Parameters

lpMemUsage
A pointer to a LARGE_INTEGER variable which will contain the number of bytes allocated for the client session when the method returns. This parameter cannot be NULL.

Return Value

If the method succeeds, the return value is non-zero. If the method fails, the return value is zero. To get extended error information, call GetLastError.

Remarks

The GetMemoryUsage method returns an approximate amount of memory currently allocated for the specified client session. This includes the client session structure, dynamically allocated session data, cached model information, and message history retained by the session.

This method is primarily intended for diagnostics, monitoring, and testing. Applications that maintain long-running sessions or retain large message histories can use this method to monitor how much memory is being used by a client session.

The value returned by this method is rounded up to the nearest system page size and should be treated as an estimate of memory usage rather than an exact byte-for-byte allocation total.

The lpMemUsage parameter points to a LARGE_INTEGER structure. The memory usage value is returned in the QuadPart member. In languages that support 64-bit integer values directly, it is safe to pass a pointer to a compatible 64-bit integer variable.

The memory usage reported by this method is limited to memory allocated for the specified client session. It does not include memory used internally by the operating system, networking libraries, provider services, or other process-wide resources.

Requirements

Minimum Desktop Platform: Windows 7 Service Pack 1
Minimum Server Platform: Windows Server 2008 R2 Service Pack 1
Header File: cstools12.h
Import Library: csllmv12.lib

See Also