-
Notifications
You must be signed in to change notification settings - Fork 140
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
Too much memory allocation/poor performance in long run tasty execution #917
Comments
Hi, i've collected some snapshots, made with
Taking a quick look:
|
So passing |
Thanks for the observation. That surely means there's a memory leak to investigate here since holding on to less info made it run faster. |
Yeah, although memory usage and gc overhead is similar between console and redirecting to file. Not sure if there is a memory leak cause once the process take the maximum memory possible the usage is pretty stable |
I have a suspicion that this has to do with native memory allocation and not the heap memory. Can you check that as well? I think the MemoryManager isn't freeing as often or as well as it should leading to native heap growing endlessly. |
In fact, not all executions to console are equal, i've taken another one and it was similar to the redirect one 🤔 I've monitored native memory taking some samples as suggested in https://stackoverflow.com/a/30941584/49554: |
Another file with native memory samples including time: |
Hmm well I was wrong about that - it looks like the native memory usage increases very gradually and in amounts < 1MB. Btw you can view native memory in VisualVM by enabling the "VisualVM-BufferMonitor" plugin. |
Wow, thanks for the tip |
Another thing that might be interesting is if the JVM is taking the memory just because it can, or if it really needs it. |
Another helpful tool is Eclipse MAT. |
@jneira If the largest number of classes you see is We probably need to implement this: A simple way to implement it is to spawn a thread when the runtime system initializes and just have it traverse the weak references to the selector thunks periodically to see if they can be reduced. More details on how this leak occurs here: |
@nightscape thanks for the tip! i am afraid that doing a gc does not free any significant memory so the 1500 Mb max seems to be needed |
Some progress updates:
It will probably take a couple more days to implement what I mentioned above. |
@jneira I've implemented both selector thunk optimization and re-enabled thunk clearing because it is now thread-safe (verified by running Wait until the docker image for the current |
In the bright side, the execution in local had a simply amazing improvement in both memory and time, fantastic work @rahulmutt: So the main goal had been achieved! But i am afraid the build in circleci hangs anyway so maybe it is caused for another reason. In my windows test the |
I am going to close this one cause the memory allocation is resolved |
When running tests or benchmarks eta executables the take excessive heap memory.
Description
Detected when running the
dhall-eta
test suite in windows and circleci (see #915 (comment) )Expected Behavior
The proccess should use less memory (not sure about how many)
Actual Behavior
The process takes up to 2.5 Gb
Possible Fix
See @rahulmutt comment: #915 (comment)
Steps to Reproduce
dhall-eta
test suite in local or circleciContext
Setup test suite for dhall-eta
Your Environment
The text was updated successfully, but these errors were encountered: