MemoryUsage Property  

Gets the amount of memory allocated for the server and all client sessions.




This read-only property returns the amount of memory allocated by the server and all active client sessions. It enumerates all memory allocations made by the server process and client session threads, returning the total number of bytes allocated for the server process. This value reflects the amount of memory explicitly allocated by this control and does not reflect the total working set size of the process, or memory allocated by any other components or libraries.

Getting the value of this property forces the server into a locked state, and all client sessions will block while the memory usage is being calculated. Because this enumerates all heaps allocated for the server process, it can be an expensive operation, particularly when there are a large number of active clients connected to the server. Frequently checking the value of this property can significantly degrade the performance of the server. It is primarily intended for use as a debugging tool to determine if memory usage is the result of an increase in active client sessions. If the value returned by this property remains reasonably constant, but the amount of memory allocated for the process continues to grow, it could indicate a memory leak in some other area of the application.

Data Type


See Also

StackSize Property