-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Memory leak in development #27273
Comments
r? @kaspth |
@printercu hey, thanks for the issue! I'm curious how you see this being related to #20384, as you say, the digests are cleared correctly? Is it possible for you to try git bisecting and finding the initial commit that contained this bug? |
@kaspth following #27271 (comment) Digests are cleared, but not the cache stores in The main point is that there are individual cache for every PathSet. And I don't really know, how cache can be made simply in a per-request way.
|
Do we expect that? 😕 Per #27271 etc, we intend to flush the cached digests on each request. But if the file(s) haven't changed, shouldn't the new digest match the old one? Maybe I'm just confused again. For both of these caches, having them global across threads, yet cleared per request/execution, makes me feel weird. Perhaps the "right" thing to do would be for the executor layer to supply a thread-local cache store that all the PathSet instances would use? (Or still a global one when the cache is permanent, of course.) |
Agree with you. Don't think we should recompile templates until they are changed. Beyond all the digest, their caches and per-request expiries, what app must do?
Please adjust the list, if it's missing something. According to it 4 & 5 are held with template-file's mtime. For now Content-cache expiration is held by hashing template content, I think app should expire this cache instead. Or just expire all template cache on every request. I think this can be done much easier. This are not my final thoughts, but I don't have time to go deeper now. This is what I came to at the moment. Here are some possibly related commits:
I've commited some of my changes to #27292. I should be easier to analyze the code. |
@printercu it doesn't take that long to see it was a pull request that did a lot of things we, on the Rails team, don't want. Here's a more elaborate explanation on why we don't accept cosmetic changes: #13771 (comment). Appreciate the effort, but we need a PR that's more tuned to the bug at hand. |
uh. Not all ruby modules are intended for inclusion. I think not so much usecases for What about eliminating dead code, is it also cosmetic change? What about moving unrelated constant to the scope it's related to? I think you just haven't give any effort to read the commit carefully. |
One more commit: #25041 |
Here are are the lines to understand:
|
Here is another one, which coupled digest cache with details key: #23756 What if revert 13c4cc3, and return object_id as hash? So there would be no collisions, and digest cache can be moved back to Digestor. /ping @tenderlove |
I think long term we need to make these caches related. I don't think it makes sense to clear one cache and not the other. For now, I think we can just clear both caches at the same time (in development). |
What caches do you mean? I think there is no need to clear DetailsKey cache at all - it just maps set of format, locale and others to some fixed value. |
@rafaelfranca here is #27296 fixing this issue. Just resolved conflicts there, I'll rebase it on master if everything is fine. |
Hi @printercu I forgot to enable Is this an intended behavior or I should file another proper issue regarding this because my issue might be a dup of this. |
Yes, I think this is the same issue. #27296 still wasn't merged. |
I'm not fully sure I understand where the original issue came from, but this variable no longer exist, and looking in some app in deveopment mode, So I'm going to assume this was fixed at some point. |
Steps to reproduce
Add lines to
ApplicationController
:Refresh page few times. See the number is increasing.
It's related to #20384. Digests are cleared, but not cache objects. I haven't found easy way to clear all caches, as every controller seems to have its own.
Expected behavior
Cache size should not be incremented infinitely.
Actual behavior
It's incremented infinitely.
System configuration
Rails version: 5.0.0.1
Ruby version: 2.3
The text was updated successfully, but these errors were encountered: