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

autokill if inactive since some time + memory becomes low? #364

Closed
rmannibucau opened this issue Feb 18, 2021 · 6 comments
Closed

autokill if inactive since some time + memory becomes low? #364

rmannibucau opened this issue Feb 18, 2021 · 6 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@rmannibucau
Copy link
Contributor

Hi,

It is common to let mvnd "leak" (it is designed for that right? ;)) but when working on other builds which take a lot of memory using mvn and not mvnd it can eat too much memory (typically the case running graal native-image in the build) - in my case mvnd was eating something around 3G.

I wonder if a condition/scheduled task to kill the daemon if inactive since some minimum time (10mn?) and memory becomes too low (85% or so of the system?) would be beneficial?

Hope it makes sense.

Romain

@gnodet
Copy link
Contributor

gnodet commented Feb 22, 2021

@gnodet
Copy link
Contributor

gnodet commented Feb 22, 2021

Your exact use case could be covered by the lowMemory but it has not been implemented. I think it requires native functions to access the system memory stats somehow.

@JanecekPetr
Copy link

I think it requires native functions to access the system memory stats somehow.

It does, indeed. The tool I've used for similar tasks before is https://github.com/oshi/oshi. The downside is that it's a 800kB library, so perhaps a less heavy (but more brittle) way would be to call an OS-specific command. Linux and Unix have free, Windows has wmic ComputerSystem get TotalPhysicalMemory.

@rmannibucau
Copy link
Contributor Author

sigar library would work as well and is quite easy to setup (as you know ;))

@gnodet
Copy link
Contributor

gnodet commented Mar 16, 2021

If it's only a couple of native functions, they could be added to jansi.

@gnodet gnodet self-assigned this Mar 18, 2021
@gnodet gnodet added the enhancement New feature or request label Mar 18, 2021
@gnodet gnodet added this to the 0.5.0 milestone Apr 27, 2021
@gnodet
Copy link
Contributor

gnodet commented Apr 27, 2021

Depends on #400

gnodet added a commit to gnodet/mvnd that referenced this issue Apr 27, 2021
@gnodet gnodet closed this as completed in 9991dce Apr 28, 2021
gnodet added a commit that referenced this issue Apr 28, 2021
Add an expiration strategy if the system has less than 5% memory available, fixes #364
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants