Javaparser: tryToParse runs very slowly and consumes a lot of memory

Created on 25 Dec 2019  路  4Comments  路  Source: javaparser/javaparser

I want to get a comprehensive abstract syntax tree(because MethodCallExpr needs to be parsed, methodCallExpr.resolve().getQualifiedSignature()).

I used the following method, but it runs very slowly and consumes a lot of memory(about 32G).

ParseResult<CompilationUnit> pr = sourceRoot.tryToParse(startPackage, fileName);

Are there other ways to increase speed and consume less memory?

Question (JP usage) Symbol Solver

All 4 comments

I just want to build an SDG for a project of about 10,000 files.

I spent 5 hours and have analyzed 420 files.

Hi! Yes, this happens more often, here is the biggest issue about it: #1391 - if you can help, that would be great.

There are also quick wins by changing the parser configuration. Turn off everything you don't need (because everything is turned on by default!)

@matozoid I set the package name and it's fine now. (Although it is still slow, the memory problem is gone)

Okay, good!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sangram82 picture sangram82  路  3Comments

huangwaylon picture huangwaylon  路  4Comments

NicoN777 picture NicoN777  路  5Comments

lingbozhang picture lingbozhang  路  4Comments

shibumi picture shibumi  路  4Comments