ruby on rails - Can .each have different GC impacts compared to .map? -


does 1 of these 2 garbage collect differently, or @ same?

array_of_strings.each |str|   mailerclass.some_template(str).deliver_later end 

vs.

array_of_strings.map |str|   mailerclass.some_template(str).deliver_later end 

i've formatted question mailer objects , task-queue stuff because it's have been working on recently, if unduly complicate answers can reword more generic.


context, relevant:

i considered .map return object pointed each object created, , .each not. [this seems not case]

i have worker machine leaks memory until crashing — happening in 1 event in pseudo-code example central action. when changed .each .map memory leak stopped, don't know how gc happening in regards these methods.

since map returns array of results of evaluating block each member of array_of_strings, there going @ least 1 object collected.


Comments

Popular posts from this blog

android - Why am I getting the message 'Youractivity.java is not an activity subclass or alias' -

python - How do I create a list index that loops through integers in another list -

c# - “System.Security.Cryptography.CryptographicException: Keyset does not exist” when reading private key from remote machine -