Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] joern server run out of memory #5138

Open
canliture opened this issue Nov 27, 2024 · 0 comments
Open

[Bug] joern server run out of memory #5138

canliture opened this issue Nov 27, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@canliture
Copy link
Contributor

canliture commented Nov 27, 2024

Describe the bug
we use joern --server to start joern query server, but it can run out of memory if joern server run after a long time.

To Reproduce
Steps to reproduce the behavior:

  1. ./joern server
  2. request query many many times, the query return a batch of many many json
  3. after a long time
  4. the server hold many many memory, it can't release the memory
  5. run out of my memory in computer

Additional context
I think we can't simply start with joern --server -J-Xmx${N}G to solve the problem, because my workstation server has 1000G memory, I use -J-Xmx500G, the memory will also be up to 500G+

I think I have guessed the reason.

the repl-server simulate a REPL interpreter. Evaluates a expression query every time, it will print a temp variable (with some counter suffix name), like

res27 = ....

if you evaluate again, it will print res28

res28 = ...

we can always use REPL to Forward Reference the temp variable res0, res1, ..., res27, res28, ... resN ..., it will never be released, it will always exists in the memory.

But in server mode, we just want to evaluate a expression and return, and soon release the temp variable memory.

I don't know how to solve the problem. Maybe it is a inherent problem in the REPL.

Thank you for your attention!

@canliture canliture added the bug Something isn't working label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant