pdf2json icon indicating copy to clipboard operation
pdf2json copied to clipboard

how to free memory used by pdf2json?

Open zihuyishi opened this issue 7 years ago • 3 comments

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

zihuyishi avatar Feb 20 '17 02:02 zihuyishi