Please move accordingly if needed.

As this is happening more and more and as I saw it might have to do with visual studio, I'm opening this. Also note I have all the update packs. VS 2019 Community 16.11.42

I quote:
"When I turn the visual studio, sometimes it give 3 lines of error on the upper corner and then complains about a low memory thing and the screen turns black!
After that I connect and disconnect the HDMI cable and the screen turns back on and after that the PC is semi responsive. P.e. I cannot do a copy paste of close the visual studio properly."

I got the log here:

Code:
 <record>1112</record>
    <time>2024/12/19 08:41:50.770</time>
    <type>Error</type>
    <source>UserConnection</source>
    <description>Unexpected exception Exception of type &apos;System.OutOfMemoryException&apos; was thrown.    at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession.DrainEventQueue()&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession.RaiseEvents(String[] propertyNames)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.IdeUserSession.&lt;ConnectAndInitializeSessionAsync&gt;d__31.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession.&lt;ConnectAsyncImpl&gt;d__48.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession.&lt;ConnectAsync&gt;d__37.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.Connected.ConnectedUser.BaseUserSession.&lt;PollConnectAsync&gt;d__49.MoveNext() for IdeUser</description>
  </entry>
  <entry>
    <record>1113</record>
    <time>2024/12/19 08:41:50.857</time>
    <type>Information</type>
    <source>VisualStudio</source>
    <description>Begin package load [GitContextPackage]</description>
    <guid>{565515AD-F4C1-4D59-BC14-AE77396DDDD7}</guid>
  </entry>
  <entry>
    <record>1114</record>
    <time>2024/12/19 08:41:50.872</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>SetSite failed for package [GitContextPackage]Source: &apos;GitHub.VisualStudio&apos; Description: Exception of type &apos;System.OutOfMemoryException&apos; was thrown.&#x000D;&#x000A;System.OutOfMemoryException: Exception of type &apos;System.OutOfMemoryException&apos; was thrown.&#x000D;&#x000A;   at GitHub.VisualStudio.GitContextPackage.&lt;InitializeAsync&gt;d__0.MoveNext()&#x000D;&#x000A;   at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine](TStateMachine&amp; stateMachine)&#x000D;&#x000A;   at GitHub.VisualStudio.GitContextPackage.InitializeAsync(CancellationToken cancellationToken, IProgress`1 progress)&#x000D;&#x000A;   at Microsoft.VisualStudio.Shell.AsyncPackage.&lt;&gt;c__DisplayClass16_0.&lt;&lt;Microsoft-VisualStudio-Shell-Interop-IAsyncLoadablePackageInitialize-Initialize&gt;b__1&gt;d.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)&#x000D;&#x000A;   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)&#x000D;&#x000A;   at Microsoft.VisualStudio.Threading.JoinableTask.&lt;JoinAsync&gt;d__76.MoveNext()&#x000D;&#x000A;--- End of stack trace from previous location where exception was thrown ---&#x000D;&#x000A;   at Microsoft.VisualStudio.Services.VsTask.RethrowException(AggregateException e)&#x000D;&#x000A;   at Microsoft.VisualStudio.Services.VsTask.InternalGetResult(Boolean ignoreUIThreadCheck)&#x000D;&#x000A;   at Microsoft.VisualStudio.Services.VsTask.GetResult()</description>
    <guid>{565515AD-F4C1-4D59-BC14-AE77396DDDD7}</guid>
    <hr>8007000e - E_OUTOFMEMORY</hr>
    <errorinfo></errorinfo>
  </entry>
  <entry>
    <record>1115</record>
    <time>2024/12/19 08:41:50.876</time>
    <type>Error</type>
    <source>VisualStudio</source>
    <description>End package load [GitContextPackage]</description>
    <guid>{565515AD-F4C1-4D59-BC14-AE77396DDDD7}</guid>
    <hr>8007000e - E_OUTOFMEMORY</hr>
    <errorinfo></errorinfo>
  </entry>
</activity>