As I mentioned before here, my relative asked me to help him with upgrading his PC. After some thinking I decided to go with Gigabyte B550 Aorus Pro AC. My relative already had good Wi-Fi USB dongle from Amazon: https://www.amazon.com/gp/product/B07S8Q18JP and it works really well. As result, I was planning to buy Gigabyte B550 Aorus Pro, but unfortunately everything was out of stock except version with Wi-Fi.

I will repeat short reasons why I decided to go with this motherboard:

From Hardware Unboxed I found this memory: https://www.amazon.com/gp/product/B07WNQQ7DM. After

Many people who are following hardware news know that AMD released B550 chipset and it is finally possible to buy B550 motherboard. And it happens to be a time when one of my relative asked me to update his system. It is quite old system based on Intel 2500K. It is 4 threads CPU and about 9 years old. It also has 8GB of RAM.

Most of the use for that computer is games and to my surprise most games work quite well on that system. But recently one game constantly uses 100% CPU and it also allocates more than 9 Gb of RAM and it makes playing experience quite uncomfortable. And as result he asked me to help

Sometime ago, my relative asked me what it is possible to do with her notebook to make it faster. This notebook was relatively old as it is about 5 years old and my first reaction was to say: “buy new one” but I am trying to be professional, so I decided to check it first. Even notebook was old, it was not bad. It has 4K monitor, secondary graphics card and relatively fast CPU. So, I asked what exactly a problem is. And after short discussion I realized that there are small operations that takes time, like opening new tab in the browser, opening some project file etc. Also, starting it will take quite some time and in general feels

Many young or new developers have sometimes hard to deal mind set. Imagine you are developing big product and you about to release it. And then QA found problem that must be fixed. Fix is small and it looks like it is affecting only really small area that can be easily tested. And there is temptation to fix it, test only that small area by R&D and release it. And I will show that there is no such thing as safe change.

But before I will go to example from my experience, I have to remind you, that any application has a lot of bugs. Even “hello world” application can have some bugs especially if it does use run-time library.

Imagine you have some field myIntf of type IMyInterface in some class and that interface is implemented in native code. In some cases, it is useful to know which thread was used to introduce this interface to .NET first time. It is useful, because this interface would be connected/attached to that thread and call of any function from that interface will attempt to marshal execution to that thread, unless it is free threaded. And this thread could be blocked, destroyed etc.

So, imagine you have following code:
myIntf.Func1();

If you add Debug.Break(); before this line code and run your application from WinDbg and wait until execution will stop. Next, press

These days many Intel based laptops have two video cards: one that built-in in CPU and much better one. This happens because Intel is not capable to making nice GPU and as result these notebooks works just fine in Windows, but their performance is quite bad for most of the games.  Unless of couse you are willing to sacrifice everything in graphics quality. And as result of that manufacturers add secondary, much better GPU, so their customers can play games. AMD has much better GPU in their APU and usually they don’t have second GPU.

And I was asked to check why Minecraft is quite slow on such Intel based laptop. Firstly, I would like to check if Minecraft in

I was asked to investigate why our application sometimes forcefully terminated by Windows. After first few minutes I did realize that Windows terminated application with STATUS_HEAP_CORRUPTION. After that I asked our QA to follow https://docs.microsoft.com/en-us/windows/win32/wer/collecting-user-mode-dumps and change DumpType to 2 to collect full crash dumps. Unfortunately, after checking few of these reports, I found that application crashing in pretty much random places: WPF rendering, DirectX engine or sometimes even in network stack. It is clear, that corruption happens some time ago and no useful information. I need different approach.

Windows has built-in feature that will allow to find few common problems. To enable these features, you need to install Windows Debugging Tools from Windows SDK and run gflags. Here

Disclaimer. This is perhaps not a best way to do, but I couldn’t find any better way.

Let’s imagine that you have some Task to run in the background. And that task has to update UI for example progress bar. Or that task has to call some callbacks in context of main thread. For firs case you would use Invoke, for second case you would use SynchronizationContext.Send. Implementation is very simple. WinForms will add request to queue of requests and post message to main thread and then it wait on request handle to be signaled. Main thread receives message, processes request and signal on request event. Very simple and quite basic. Post is the same as Send but

In this post I will explain my investigation about handle leaks and how it resulted in interesting discovery in MemoryCache class.

I received few reports stating that our application consuming handles even when it supposed to do nothing. And then I started my investigation. I explained how to find where is leaking handles here.

After application leaked about 50 handles, I paused application and checked call stack. And to my surprise I found a lot of callstack that looks like this:

ntdll!NtCreateThreadEx+0x0000000000000014
KERNELBASE!CreateRemoteThreadEx+0x0000000000000294
KERNELBASE!CreateThread+0x000000000000003b
verifier!AVrfpCreateThread+0x00000000000000bf
clr!Thread::CreateNewOSThread+0x00000000000000b2
clr!Thread::CreateNewThread+0x0000000000000091
clr!ThreadpoolMgr::CreateUnimpersonatedThread+0x00000000000000cb
clr!ThreadpoolMgr::MaybeAddWorkingWorker+0x000000000000011c
clr!ManagedPerAppDomainTPCount::SetAppDomainRequestsActive+0x0000000000000024
clr!ThreadpoolMgr::SetAppDomainRequestsActive+0x000000000000003f
clr!ThreadPoolNative::RequestWorkerThread+0x000000000000002b
--------------------------------------
ntdll!NtCreateEvent+0x0000000000000014
verifier!AVrfpNtCreateEvent+0x0000000000000080
KERNELBASE!CreateEventW+0x000000000000006b
verifier!AVrfpCreateEventW+0x00000000000000a5
clr!CLREventBase::CreateManualEvent+0x000000000000003a
clr!Thread::AllocHandles+0x000000000000007b
clr!Thread::CreateNewOSThread+0x000000000000007f
clr!Thread::CreateNewThread+0x0000000000000091
clr!ThreadpoolMgr::CreateUnimpersonatedThread+0x00000000000000cb
clr!ThreadpoolMgr::MaybeAddWorkingWorker+0x000000000000011c
clr!ManagedPerAppDomainTPCount::SetAppDomainRequestsActive+0x0000000000000024
clr!ThreadpoolMgr::SetAppDomainRequestsActive+0x000000000000003f
clr!ThreadPoolNative::RequestWorkerThread+0x000000000000002b
mscorlib_ni!DomainNeutralILStubClass.IL_STUB_PInvoke()$##6000000+0x0000000000000069

From this callstack it wasn’t really obvious what part of