antlr4 icon indicating copy to clipboard operation
antlr4 copied to clipboard

[Java] Memory Leak

Open xuanziranhan opened this issue 2 years ago • 7 comments

  • [x] I have reproduced my issue using the latest version of ANTLR
  • [x] I have asked at stackoverflow
  • [x] Responses from the above seem to indicate that my issue could be an ANTLR bug
  • [x] I have done a search of the existing issues to make sure I'm not sending in a duplicate

Please include the following information:

  • We are using java Antlr4.
  • There's memory leak in the DFA[] static array. We have tried to clear it every time, the memory usage went up and down, but the performance went 10 times worse.

We are using Antlr4 for parsing sql queries. But the memory usage went up and stuck there all the time. I tried to run the service locally for a while with profiling, and saw the things are accumulated. Screenshot 2023-08-05 at 4 25 25 PM

xuanziranhan avatar Jan 16 '24 01:01 xuanziranhan

There's memory leak in the DFA[] static array. We have tried to clear it every time, the memory usage went up and down, but the performance went 10 times worse.

I'm afraid it's limitation of ALL algorithm. It relies caching and cache clearing may cause performance degradation.

KvanTTT avatar Jan 17 '24 12:01 KvanTTT

But I'm going to investigate the problem more deeply during developing the new ANTLR 5.

KvanTTT avatar Jan 17 '24 12:01 KvanTTT