Guo Xiang Tan 982e3d04f6 PERF: Allow memory to be freed instead of fetching all the objects into memory at once.
```
MemoryProfiler.report do
  Jobs::UserEmail.new.execute(type: :mailing_list, user_id: user.id)
end.pretty_print
```

Before:
```
Total allocated: 180096119 bytes (1962025 objects)
Total retained:  2194 bytes (16 objects)

allocated memory by gem
-----------------------------------
  66979096  activerecord-4.2.8
  43507184  nokogiri-1.7.1
  43365188  mail-2.6.4
   5960201  activesupport-4.2.8
   5056267  discourse/lib
   4835284  rack-mini-profiler-0.10.1
   3825817  arel-6.0.4
   2186088  i18n-0.8.1
   1719330  discourse/app
```

After:
```
Total allocated: 161935975 bytes (1473940 objects)
Total retained:  2234 bytes (17 objects)

allocated memory by gem
-----------------------------------
  45430264  activerecord-4.2.8
  43568627  nokogiri-1.7.1
  43430754  mail-2.6.4
  11233878  rack-mini-profiler-0.10.1
   5260825  activesupport-4.2.8
   5054491  discourse/lib
   2186088  i18n-0.8.1
   1822494  arel-6.0.4
```
2017-05-03 17:01:57 +08:00
..
2016-12-22 16:46:53 +11:00
2017-03-11 14:25:09 +08:00
2015-08-19 16:57:26 +10:00
2016-02-23 10:33:53 +11:00
2016-02-23 10:33:53 +11:00
2017-04-15 12:29:00 +08:00
2016-06-17 11:28:49 +10:00
2016-06-17 11:28:49 +10:00
2017-04-15 12:29:00 +08:00
2017-04-12 10:53:49 -04:00
2016-02-23 10:33:53 +11:00
2017-03-22 14:26:53 +08:00
2016-08-15 17:59:36 +10:00
2016-10-31 15:02:11 +05:30
2017-04-15 12:29:00 +08:00
2016-02-23 10:33:53 +11:00
2017-03-30 13:24:18 +08:00
2016-10-31 15:02:11 +05:30
2016-02-23 10:33:53 +11:00
2016-03-28 15:21:45 +11:00
2016-02-23 10:33:53 +11:00
2016-12-12 17:29:54 +08:00
2015-09-18 10:41:10 +10:00
2016-05-30 10:45:32 +10:00
2016-03-28 15:21:45 +11:00
2016-09-22 09:52:19 -04:00
2015-09-18 10:41:10 +10:00
2016-02-23 10:33:53 +11:00
2016-05-30 10:45:32 +10:00
2016-02-23 10:33:53 +11:00
2017-04-15 12:29:00 +08:00
2016-12-22 16:46:53 +11:00
2015-09-18 10:41:10 +10:00
2016-02-23 10:33:53 +11:00
2016-12-22 16:46:53 +11:00
2016-02-23 10:33:53 +11:00
2015-09-18 10:41:10 +10:00
2016-11-24 10:13:03 +08:00
2016-02-23 10:33:53 +11:00
2016-02-23 10:33:53 +11:00
2016-10-31 15:02:11 +05:30
2016-06-17 11:28:49 +10:00
2016-06-17 11:28:49 +10:00
2014-04-08 17:35:44 +02:00
2016-05-30 10:45:32 +10:00
2017-04-25 18:40:39 +05:30
2017-02-22 12:20:50 -05:00
2016-05-30 10:45:32 +10:00
2017-03-22 14:26:53 +08:00
2016-05-30 10:45:32 +10:00
2015-09-14 10:48:24 +02:00
2016-02-23 10:33:53 +11:00
2017-04-20 15:21:43 +08:00
2016-10-31 15:02:11 +05:30
2017-03-22 14:26:53 +08:00
2017-03-22 14:26:53 +08:00
2016-11-24 10:13:03 +08:00
2016-02-23 10:33:53 +11:00
2016-02-23 10:33:53 +11:00
2016-12-22 16:46:53 +11:00
2017-04-12 10:53:49 -04:00
2016-02-23 10:33:53 +11:00
2014-07-03 17:29:44 +10:00
2016-10-31 15:02:11 +05:30