AddMemoryPressure( ) and RemoveMemoryPressure( ) methods are used to indicate that a large amount of unmanaged memory has been allocated or released by the program. They are important because the memory management system has no control over unmanaged memory. If a program allocates a large amount of unmanaged memory, then performance might be affected because the system has no way of knowing that free memory has been reduced.
By calling AddMemoryPressure( ) when allocating large amounts of unmanaged memory, you let the CLR know that memory has been reduced.
By calling RemoveMemoryPressure( ), you let the CLR know the memory has been freed.
RemoveMemoryPressure( ) must be called only to indicate that memory reported by a call to AddMemoryPressure( ) has been released.
By calling AddMemoryPressure( ) when allocating large amounts of unmanaged memory, you let the CLR know that memory has been reduced.
By calling RemoveMemoryPressure( ), you let the CLR know the memory has been freed.
RemoveMemoryPressure( ) must be called only to indicate that memory reported by a call to AddMemoryPressure( ) has been released.
No comments:
Post a Comment