Display_text documentation/behaviour

I am tracking some memory leaks in our application. Unfortunately I am not actually very familiar with the deepstream SDK and the documentation I have found seems quite thin,

Is it documented anywhere who is supposed to free NvOSD_TextParams display_text for NvDsDisplayMeta objects from the nvds_acquire_display_meta_from_pool?

I see in every sample app strings get allocated from the heap and assigned to display_text. They do not seem to get freed.

An example is here:
sources/apps/sample_apps/deepstream-nvdsanalytics-test/deepstream_app_main.c (look at overlay_graphics)

But notice that font_name in the same function is not from the heap.

This is very confusing. And if it is true that display_text is freed when the NvDsDisplayMeta object is recycled I find this to be a particularly terrible implementation. And if not then do all these samples leak memory?

Freeing objects should be the responsibility of the the allocator not transferred. What if I want to allocate all my strings from a pool instead of thrashing the heap?

• Hardware Platform: Jetson Nano
• DeepStream Version: 5.0.1
• JetPack Version: 4.4

Here is the latest DS Doc https://docs.nvidia.com/metropolis/

Not sure how this answers the question:

Here is the documentation on display_text:
struct _NvOSD_TextParams

Holds parameters of text to be overlayed.

Public Members

char * display_text

Holds the text to be overlayed.

It says nothing about allocating it from the heap

it’s freed in libnvds_meta.so which is not open sourced

2 Likes