Skip to content

FrameData.Bytes() alloc memory and never free #140

@JoeyLee0201

Description

@JoeyLee0201

Hi, I recently implemented a progress via learning demuxing_decoding

I wrote a function to handle video frame like this:

func (vl *VideoLoader) handleVideoFrame(ctx context.Context, frame *astiav.Frame) {
	bytes, err := frame.Data().Bytes(1)
	if err != nil {
		return
	}

	vdieoFrame := utils.BuildVideoFrame(frame.Width(), frame.Height(), bytes, nil)

	// do something
	return
}

I make sure to have called frame.Unref() and frame.Free(), and I notice the heap about in_use_space is released correctly, but there is still memory allocated which is releated to FrameData in alloc_space, even after for a long time later.
Do you have any idea about this issue?

Thank you !

380: 1182924800 [1514687: 4715160043520] @ 0x2afe168 0x2af9d02 0x2bb266a 0x2bb17bc 0x2bb13b3 0x2bb0d4a 0x63a101
#	0x2afe167	github.com/asticode/go-astiav.(*frameDataFrame).bytes+0x407 
 /opt/tiger/compile_path/pkg/mod/github.com/asticode/[email protected]/frame_data.go:284
#	0x2af9d01	github.com/asticode/go-astiav.(*FrameData).Bytes+0x81	 
 /opt/tiger/compile_path/pkg/mod/github.com/asticode/[email protected]/frame_data.go:39
#	0x2bb2669	avloader.(*VideoLoader).handleVideoFrame+0x1c9	/avloader/loader.go:368
#	0x2bb17bb	avloader.(*VideoLoader).loadFrame.func2.1+0x35b	/avloader/loader.go:289
#	0x2bb13b2	avloader.(*VideoLoader).loadFrame.func2+0x5f2	/avloader/loader.go:326
#	0x2bb0d49	avloader.(*VideoLoader).loadFrame+0x4a9		/avloader/loader.go:331

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions