Free copied buffer
Nobody has claimed this yet.
- Dominant language
- C++
- Stars
- 3.4k
- Forks
- 531
- Avg merge
- 21m
- Merged PRs (30d)
- 1
Description
Sorry to open it again. For the first time I use git, i am not able to upload file, but for now, i can. The situation is following:
I am currently writing a addon for node , which read media file(.mp4) as source ,output .ts file as result. (A small hls server ) Everything went well, I believe everything are correctly freed in C++ part. I am using async worker to output buffer response to express. In C++ part I used CopyBuffer(NewBuffer could not work) to create correct result for buffer. The problem is following, when the request was canceled before the response, the buffer could not be free at all, it.contiuesly grows. It result in memory leak. So I am wondering, is it a way to free those copied buffer by nodejs if the request is canceled.
The library used to read a mp4 file is Bento4, and I use streaming-worker to write back to nodejs.
It could be some problem of nodejs, as @addaleax method, but I would like to share the issue here again.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the attached main.zip and trace the async worker path that uses CopyBuffer to send the media response to Express. Reproduce a canceled request and inspect whether the copied buffer is released; done means repeated cancellations no longer cause the buffer or process memory to grow.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp, express, node.js
- Domain
- api, backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100