2022.25370 - TOP Screengrab: Memory Leak when grabbing via pulse

Hi there,
I’m working on a project which will send remote clients desktop back to the server via ndi. So safe some performance and bandwidth I’m taking a screenshot e.g.twice a second. Grabbing the screen with just the “pulse” function and disabled “Active” results in a heavy memory leak:

Tested Version: 2022.25370
Windows 10, RTX 2080

Testfile:
TD_2022_25370_TOP_Screengrab_pulsed_MemoryLeak.toe (3.8 KB)

Best regards
Janni

Have you had any crashes occur due to this? I can reproduce this easily and see the memory grow until my GPU mem is full, but then it stops. I can then go and create a bunch of huge TOPs and they all work fine.
I think this is actually either a lazy cleanup occurring in the Windows capture subsystem, or possibly just an error with the memory reporting. I’ve seen this before with some of the DirectX/Vulkan interop workflows, which the screengrab makes use of.

I’ve tweaked the code a bit to avoid this extra memory counting behavior, but it’s still possible it was a red herring

Hi Malcom,

thank you for looking into this. The memory leak does not appear when using the “normal” way with active operator and not pulsing.

When memory is full, I have a huge performance loss.

Best wishes
Janni

@imihailidis we just posted 2022.26590, give it a try and see how memory behaves for you.

I still get a huge memory leak just by dropping screengrabTOP into a new project (Build 2022.33600).

Build 2021.16960 does not have this problem, so I am wondering if the combination of intel GPU and Vulkan is the cause.

Could you please fix this problem?
Thanks in advance.

my pc specs :
Win10
Intel 11th i7
Intel Iris Xe Graphics