You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While investigating #117, #127, and #134, I noticed that the #default_proc usage in MIME::Types::Container could potentially cause uncontrolled growth in memory by the constant querying of unknown types and/or extensions.
MIME::Types::Container was originally a subclass of Hash with a default Proc (->(h, k) { h[k] = Set.new }) and some methods to assist with JSON/YAML encoding and Marshal support (because the presence of the default_proc breaks those things or is missing on restoration).
This particular implementation is extremely useful during construction, because it allowed for the simplification of a number of call-sites, but it had the unintended consequence of recording every missed query and adding an empty (but mutable) Set during normal (and much more frequent) execution.
The text was updated successfully, but these errors were encountered:
While investigating #117, #127, and #134, I noticed that the
#default_proc
usage inMIME::Types::Container
could potentially cause uncontrolled growth in memory by the constant querying of unknown types and/or extensions.MIME::Types::Container
was originally a subclass ofHash
with a defaultProc
(->(h, k) { h[k] = Set.new }
) and some methods to assist with JSON/YAML encoding and Marshal support (because the presence of thedefault_proc
breaks those things or is missing on restoration).This particular implementation is extremely useful during construction, because it allowed for the simplification of a number of call-sites, but it had the unintended consequence of recording every missed query and adding an empty (but mutable) Set during normal (and much more frequent) execution.
The text was updated successfully, but these errors were encountered: