Menu

#61 Unnecessary Garbage collection triggered by .NET wrapper

open
nobody
None
5
2010-11-01
2010-11-01
Dale Wilson
No

Message.h in the .NET wrapper calls GC::AddMemoryPressure(2048) then GC::RemoveMemoryPressure(2048)
The MSDN documentation says that AddMemoryPressure can be used to:
"Inform the runtime of a large allocation of unmanaged memory that should be taken into account when scheduling garbage collection."

2K hardly constitutes a large allocation of unmanaged memory, The problem with doing this is it sometimes triggers a complete garbage collection cycle at a time when the application is concerned about latency.

These calls are unnecessary and should be removed.

Dale

Discussion


Log in to post a comment.