-
Notifications
You must be signed in to change notification settings - Fork 81
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
Problems About Memory Monitoring #125
Comments
Thansk for raising this issue! Interesting. I would assume the sandbox will add the interrupt function and then call that for every loop run.
You can double check what JS is generated by setting the following property I don't think so that this should lead to a memory leak. Maybe it is Nashorn internals that allocate more objects? |
Thank you for your answer, I'm not saying it caused a memory leak, but I'm asking why the memory increases has anything to do with this injection method, which seems to be very simple. |
Because now I find that some js code that shouldn't have gone out of memory is now out, but I'm not sure how I should analyze it. |
Yes I don't see anything in the code here that could cause a memory leak. I would assume it is some allocation that Nashorn may make upon every method invocation. But if you see anything in the code generated by the sandbox that looks like it could cause a memory leak, please let me know and happy to patch it then! |
hreadMonitor.registerThreadToMonitor(Thread.currentThread())
Hello, I'd like to ask if this.threadToMonitor may be empty if Thread.currentThread is in the interrupt state. |
Hello mxro, I find a strange phenomenon. My total heap memory is only 800 MB, but the sandbox calculates 3488 MB. I don't know why the error is so large. |
Could this be related to the stage memory delight-nashorn-sandbox/src/main/java/delight/nashornsandbox/internal/ThreadMonitor.java Line 65 in 73b8a92
Otherwise the Sandbox doesn't do much else than just read the memory through the bean: delight-nashorn-sandbox/src/main/java/delight/nashornsandbox/internal/ThreadMonitor.java Line 205 in 73b8a92
|
It can't be related to stage memory. I used version 0.2.0. |
After my thread runs for a long time, the memory value suddenly increases at some point. I suspect that the memory calculation thread becomes inaccurate after running for a long time. |
delight-nashorn-sandbox/src/main/java/delight/nashornsandbox/internal/ThreadMonitor.java Line 65 in 73b8a92
This problem also occurs when threads whose memory is less than 100 MB run for a long time. You are advised to modify this problem. |
So what would be the easiest solution? |
I'm not sure at present. I just set the memory limit to 100 MB and used the segment calculation, but I found that the error still exists just to avoid it. |
In the following case, an infinite loop is performed, but I do not know why the memory usage increases sharply.
The text was updated successfully, but these errors were encountered: