提交 60bf5707 编写于 作者: P Paul Harrington

Merge pull request #6294 from pharring/LowVMTelemetry

Log low VM telemetry at most once per session
......@@ -18,6 +18,7 @@ namespace Microsoft.VisualStudio.LanguageServices
internal sealed class VirtualMemoryNotificationListener : ForegroundThreadAffinitizedObject, IVsBroadcastMessageEvents
{
private WorkspaceCacheService _workspaceCacheService;
private bool _alreadyLogged;
[ImportingConstructor]
private VirtualMemoryNotificationListener(
......@@ -52,8 +53,12 @@ public int OnBroadcastMessage(uint msg, IntPtr wParam, IntPtr lParam)
case VSConstants.VSM_VIRTUALMEMORYLOW:
case VSConstants.VSM_VIRTUALMEMORYCRITICAL:
{
// record that we had hit critical memory barrier
Logger.Log(FunctionId.VirtualMemory_MemoryLow, KeyValueLogMessage.Create(m => m["Memory"] = msg));
if (!_alreadyLogged)
{
// record that we had hit critical memory barrier
Logger.Log(FunctionId.VirtualMemory_MemoryLow, KeyValueLogMessage.Create(m => m["Memory"] = msg));
_alreadyLogged = true;
}
_workspaceCacheService.FlushCaches();
break;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册