Hello 黎庆文,
Thank you for reaching out.
Creating a new ContextMenu for every single right-click seems inefficient.
Each time you create a new ContextMenu, it allocates not just managed memory in your app, but also unmanaged resources within these Windows services.
When you create and destroy menus very quickly, the system can't clean up these resources fast enough. This leads to a gradual memory buildup in ctfmon.exe.
The best practice is to create a single ContextMenu once and reuse it.
I hope this helps. If my answer is useful, please consider marking it as final.
Thank you.