#14909 closed enhancement (fixed)
remove synthetic modules from modules cache to allow GC
Reported by: | ben hockey | Owned by: | Rawld Gill |
---|---|---|---|
Priority: | low | Milestone: | 1.9 |
Component: | Loader | Version: | 1.7.2 |
Keywords: | Cc: | ||
Blocked By: | Blocking: |
Description (last modified by )
the synthetic (require* + uid()
) modules don't need to be cached. by deleting them from modules
they can be garbage collected. by adding the following patch to finishExec
in dojo.js, using chrome's profiling tools, i was able to observe the retained size for the modules
cache drop from 1.2Mb to 400kb
-
dojo.js
1083 1082 i++; 1084 1083 } 1085 1084 } 1085 // delete references to synthetic modules 1086 if (/^require\*/.test(module.mid)) { 1087 delete modules[module.mid]; 1088 } 1086 1089 }, 1087 1090 1088 1091 circleTrace = [],
it's possible that there's a better place to put these few lines and perhaps a better regular expression could be used but that was my best stab at it.
Change History (7)
comment:1 Changed 10 years ago by
Description: | modified (diff) |
---|
comment:2 follow-up: 4 Changed 10 years ago by
Status: | new → assigned |
---|
thanks neonstalwart; good point.
I think we need to look at some other places this kind of strategy can be followed as well (e.g., once a module is fully defined, the only thing that is really necessary to keep is the result).
comment:4 Changed 10 years ago by
Milestone: | tbd → 1.8 |
---|---|
Priority: | undecided → low |
Replying to rcgill:
I think we need to look at some other places this kind of strategy can be followed as well (e.g., once a module is fully defined, the only thing that is really necessary to keep is the result).
yes, there's probably more places to apply this. your example (only keeping the result for fully defined modules) set me off on a tangent thinking about what should happen when 2 module ids map to the same url - see https://groups.google.com/d/topic/amd-implement/E4ue9Q9Fimc/discussion for details.
btw, i'm updating some of the metadata for this ticket so it doesn't fall through the cracks but feel free to adjust as needed.
comment:5 Changed 10 years ago by
Milestone: | 1.8 → 2.0 |
---|
1.8 is frozen. Move all enhancements to next release. If you need an exemption from the freeze for this ticket, contact me immediately.
comment:6 Changed 9 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
This was fixed some time ago, but never marked as such.
fyi - the results i mentioned were measured on an app i'm working on.