-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
Garbage Collection not working #3503
Comments
@stockf without looking I am betting we store the temporary variable of the created arrays and since we never leave this scope those temps have not been cleared. If we fully compile these scripts I suspect those temps will be detected to be unused and eliminated (and suddenly the leak will disappear due to DCE running). It is only an educated guess (and noted for first person who looks into this. Speculatively marking as IR bug... |
I don't see any variables in your code - do you assign these arrays to anything? |
@chrisseaton you're right, in the above example I didn't even assign it to a variable. The result is the same, though, if you put |
I does make sense that the array is being stored in a temporary, as @enebo says. This is a common problem in compilers - you innocently store some value somewhere and forget to clear it, only to find it's hanging on to the entire world. |
A small improvement here might be to not store temporary values if they're never read; This might happen via DCE or it might not. This is definitely not something we're going to fix in 9.0.5.0 timeframe, though, so I'm punting. |
@subbuss Your input would be helpful here. Can we make result-generating instructions not actually store anything if their results are never read? |
Yes, this is a problem with the references being held in the tmp-var array. This is primarily a problem with the 'startup interpreter' which runs code right after building the IR. One way to fix this is if we have information (via AST @ IR build time) about output of statements aren't used. If known, then for the IR instructions corresponding to those AST nodes, the tmp vars (these will be tmp vars if the result is dead) used as the instruction result can be marked dead which can be used by the interpreter to skip the store. |
This is an issue but one which requires a lot of work and we have a lot to do. To effectively untargetting it from near term work but not to the point that it is totally untargetted. |
As described here: http://stackoverflow.com/questions/33824399/jruby-outofmemoryerror-very-small-example?noredirect=1#comment55640031_33824399
when allocating memory to the same variable again and again, it does not seem to be garbage collected and eventually throws an OutOfMemory error or
Error: Your application used more memory than the safety cap of 500M.
This bug is present in jruby 9.0.4.0 and 9.0.1.0 but not in jruby 1.7.23. (I did not check other versions).
The text was updated successfully, but these errors were encountered: