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

Allow to configure memory allocation for UTBot #2664

Open
tyuldashev opened this issue Oct 23, 2023 · 13 comments
Open

Allow to configure memory allocation for UTBot #2664

tyuldashev opened this issue Oct 23, 2023 · 13 comments
Assignees
Labels
comp-codegen Issue is related to code generator ctg-enhancement New feature, improvement or change request spec-performance Performance-related issue

Comments

@tyuldashev
Copy link
Collaborator

tyuldashev commented Oct 23, 2023

Description
Sometimes during test generation UTBot fails with OutOfMemoryError exception (see comment ). Currently UTBot subprocess starts with default memory settings and user cannot change it to resolve such problem.

Expected behavior
There is setting .utbot\settings.properties file to change memory allocation settings. For now it seems to be a rare problem, so I think we should not expose it to IDEA settings UI.

Potential alternatives
Dynamically decide how much memory to use based on available memory. But that seems more error-prone solution and may not resolve such problem.

@tyuldashev tyuldashev added the ctg-enhancement New feature, improvement or change request label Oct 23, 2023
@tosha63
Copy link

tosha63 commented Oct 23, 2023

Where is the settings file located?

@tyuldashev
Copy link
Collaborator Author

tyuldashev commented Oct 23, 2023

Where is the settings file located?

Should be here: C:\Users\xxxxx\.utbot\settings.properties

@tyuldashev
Copy link
Collaborator Author

tyuldashev commented Oct 26, 2023

Hi, @tosha63
We've prepared dev-build with such option, could you try it and let us know results?
How to:

  • Add to C:\Users\xxxxx\.utbot\settings.properties file new line with VM memory option for child process
engineProcessJavaOptionalArguments="-Xmx4g"
  • Download utbot-intellij-IU-deni-2023.10.27-build plugin
  • Install it in IDEA: Settings->Plugins->Gear icon->Install Plugin from disk
  • Restart IDEA (restart it again every time you change memory option)
  • Try to generate tests

@tyuldashev tyuldashev added comp-codegen Issue is related to code generator spec-performance Performance-related issue labels Oct 26, 2023
@tosha63
Copy link

tosha63 commented Oct 26, 2023

Good afternoon
I downloaded a new plugin and installed it. I added the option, but I get the same error.
Maybe I'm doing something wrong?

image

@denis-fokin
Copy link
Collaborator

Good day, could you verify that the option takes effect?
Please, specify -Xms10g and check in Process Explorer or other similar tool that the memory consumption increased by 10g.

@tosha63
Copy link

tosha63 commented Oct 26, 2023

Before the launch it was 18.2GB, after starting the test generation it was 28.8GB

image

@denis-fokin
Copy link
Collaborator

Could you substitute -Xms10g with -Xmx25g (not -Xms25g) now and check if the analysis eats up the memory? I just want to be sure that Soot indeed consumes all the memory and it is not constrained by other options.

@tosha63
Copy link

tosha63 commented Oct 26, 2023

image

@denis-fokin
Copy link
Collaborator

If you cannot provide your example, you can try to simplify the method under test. Looks like in your particular situation there is some specific logic under the hood. Another solution is to try UTMock assumes (docs/AssumptionsMechanism.md). Finally, you can try to use only the fuzzing engine.

@tosha63
Copy link

tosha63 commented Oct 27, 2023

I tried to run generation even on simple methods in our project, but an error occurs. I used the fuzzing engine, everything is the same

@denis-fokin
Copy link
Collaborator

I meant that you could try to decompose the method under test. What did you do to enable fuzzing only analysis?

@tosha63
Copy link

tosha63 commented Oct 27, 2023

image

@denis-fokin
Copy link
Collaborator

In that case the issue is in Soot without doubts. It is difficult to do anything about it without a reproducer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
comp-codegen Issue is related to code generator ctg-enhancement New feature, improvement or change request spec-performance Performance-related issue
Projects
Status: Todo
Development

No branches or pull requests

3 participants