I notice lag when closing my application in visual studio, further investigation resulted in logging info to the output window of visual studio to be the culprit.
Attached you will find a simple visual studio 2017 project, that contains a winmain that will send 100 messages to the debuggers output window, and then measure the time this took.
If you run this with ransomware protection ON, than it takes 500ms (on my system), and if you run it with ransomware protection OFF, it only takes 6ms!!!
Since I spend most of my day in visual studio, I can now no longer use the ransomware protection, as it creates major annoying lag moments.
Please investigate what is going wrong here with the ransomware detection!
Used software is Visual Studio Enterprise on Windows 10 with Malwarebytes Premium v3.5.1.
Here is the winmain.cpp code, in case you rather create your own project:
#pragma comment( lib, "winmm.lib" )
int WINAPI WinMain( HINSTANCE hinstance, HINSTANCE hprevinstance, LPSTR lpcmdline, int ncmdshow)
// Start the timer
timeBeginPeriod( 1 );
unsigned long startTime = timeGetTime();
// Send a lot of messages to the output window of visual studio
char outputMsg = "\0";
int testSize = 1000;
for (int msg = 0; msg < testSize; ++msg)
sprintf_s( outputMsg, 255, "Dummy output msg %4d\n", msg+1 );
// Compile a msg
OutputDebugString( outputMsg );
// End the timer
unsigned long endTime = timeGetTime();
timeEndPeriod( 1 );
// Show result
char result = "\0";
sprintf_s( result, 255, "Sending %d messages to VS output took %d ms", testSize, endTime-startTime );
::MessageBoxA( NULL, result, "MBAM output test result", MB_OK );