1

I am using JavaParser 3.16.1,

Whenever I use LexicalPreservingPrinter.setup(CompilationUnit node) the memory usage keeps going up.

I keep going through a folder full of java files and using javaparser.parse I parse each files , I get a return value of type CompilationUnit after this I call LexicalPreservingPrinter.setup(CompilationUnit node). This is in a plugin. I see the memory usage keeps going up. If I comment LexicalPreservingPrinter.setup(CompilationUnit node) the memory usage is constant. I tried removing LexicalPreservingPrinter.setup(CompilationUnit node) and calling ParserConfiguration.setLexicalPreservationEnabled(true) the memory usage kept growing. Can you suggest something to reign in the memory usage.

The problem with this is the garbage collector never reclaims the memory and being a plug-in the ide runs out of memory.

Maths
  • 15
  • 3

0 Answers0