
Ruby's external malloc problem - pjungwir
https://samsaffron.com/archive/2018/06/13/ruby-x27-s-external-malloc-problem
======
pjungwir
I learned of this issue recently when someone corrected me on StackOverflow
about using ActiveRecord::Base.connection.execute, which leaks memory, and
pointed me to exec_query instead.[1] Here that behavior is why ActiveRecord
can't lazy-allocate a result set. Sam is doing great work lately on
ActiveRecord memory use; I've learned a lot reading his articles, and it
sounds like he is really building up enough knowledge to implement some
improvements.

[1] [https://stackoverflow.com/questions/4483049/how-to-
execute-a...](https://stackoverflow.com/questions/4483049/how-to-execute-a-
raw-update-sql-with-dynamic-binding-in-
rails/24520455?noredirect=1#comment86619406_24520455)

