High memory usage on DeckLink SDK 10.8

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

LarsWesselius

  • Posts: 5
  • Joined: Wed Apr 19, 2017 8:33 am

High memory usage on DeckLink SDK 10.8

PostWed Apr 19, 2017 8:36 am

Hi,

Been profiling my application using DeckLinkInput and DeckLinkOutput at the same time, and it seems that the DeckLinkAPI is using 500-700mb of memory in my application. This is a C# application, and the memory is shown under the DeckLinkAPI module as unmanaged memory (which obviously makes sense).

Can anyone tell me why the DeckLink API would be taking so much memory? Is it my code, or DeckLink itself? Anything I can try to reduce it?

Edit: I've figured out that it's specifically a DeckLinkInput where I'm ignoring the video frames and just using the audio samples.
Offline

Waqqas Sharif

Blackmagic Design

  • Posts: 21
  • Joined: Tue Oct 04, 2016 1:47 am

Re: High memory usage on DeckLink SDK 10.8

PostWed May 17, 2017 5:41 am

Hello Lars,

The described memory usage pattern is indeed expected when using the default allocator (e.g. used by the Capture sample).

The DeckLink API will by default allocate a buffer sufficient for approximately 1 second of video frames in the largest video mode / pixel format combination.

This memory is then partitioned to create the video frame buffers in other video modes.

It should be possible to reduce the amount of memory allocated by implementing a custom IDeckLinkMemoryAllocator which rejects allocation attempts beyond some application defined limit.

To implement a custom allocator, implement the IDeckLinkMemoryAllocator[1] interface, and pass an instance of your allocator to the IDeckLinkOutput::SetVideoOutputFrameMemoryAllocator[2] method which will replace the default allocator with your custom instance.

Regards
Waqqas

[1] 2.5.18 IDeckLinkMemoryAllocator Interface
[2] 2.5.3.7 IDeckLinkOutput::SetVideoOutputFrameMemoryAllocator method

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 6 guests