how to free memory used by pdf2json?
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 2.2k
- Forks
- 394
- Avg merge
- 3d 5h
- Merged PRs (30d)
- 7
Description
I have a server that run four process to handler client side pdf.
I found that when client side send a 10mb pdf file, one process will used 400mb memory and never free it.
When run it for long time and receive some big pdf, it will take me about 4gb memory, and make other app down.
I have a test code like this
const pdfParser = new PDFParser(this, 1);
pdfParser.on('pdfParser_dataReady', pdfData => {
console.log('--------------raw-----------------');
console.log(pdfParser.getRawTextContent());
});
pdfParser.loadPDF('/Users/saye/Downloads/Gradle_Recipes_for_Android.pdf');
let server = http.createServer((req, res) => {
res.write('hello');
res.end();
});
server.listen(2345);
so what should I do to make memory free
Contributor guide
No contributing guide indexed for this repository
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 by reproducing the memory growth with the shown PDFParser example and the referenced Gradle_Recipes_for_Android.pdf file, then observe memory across repeated calls to loadPDF and pdfParser_dataReady. Done means the cause of retained memory is identified and memory is reclaimed after processing, with the behavior verified under repeated large-PDF requests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100