Due to a memory leak issue on L4T 28.1 (https://devtalk.nvidia.com/default/topic/1044597/jetson-tx2/nvvideoencoder-repeated-start-stop-causes-crash-and-memory-leak) we moved our product to L4T 28.2 and modified the multimedia api code with the new features of 28.2 (x4 as we have 4 channels):
MIPI -> DMABUF -> NvBufferTransform() -> Encoder DMABUF -> Encoder capture plane.
In a test I started/stopped all 4 channels in a loop and checked memory usage, which still increases with the number of restarts.
Then I created a simple function which does the following in a loop:
- Allocates 40 4k buffers (~660 mbytes)
- Maps the buffers to pointer
- Syncs the buffers to CPU
- Writes some dummy data into the buffers
- Syncs the buffer to device
- Unmaps the buffers
- Destroys the buffers
The result is the same, memory usage (by tegrastats) increases wit every loop iteration.
I also tried the same code on Jetson with the official L4T.
Am I doing something wrong?
Thanks in advance.